From ee067b7d65dbaebeb6995f643fc4366c7a52e215 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 26 Mar 2021 12:09:37 -0700 Subject: [PATCH 1/7] Fixes error adding unlisted statuses --- bookwyrm/activitystreams.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bookwyrm/activitystreams.py b/bookwyrm/activitystreams.py index 88f1f0114..6fa367008 100644 --- a/bookwyrm/activitystreams.py +++ b/bookwyrm/activitystreams.py @@ -88,7 +88,7 @@ class ActivityStream(ABC): """ given a status, what users should see it """ # direct messages don't appeard in feeds, direct comments/reviews/etc do if status.privacy == "direct" and status.status_type == "Note": - return None + return [] # everybody who could plausibly see this status audience = models.User.objects.filter( @@ -150,7 +150,7 @@ class LocalStream(ActivityStream): def stream_users(self, status): # this stream wants no part in non-public statuses if status.privacy != "public" or not status.user.local: - return None + return [] return super().stream_users(status) def stream_statuses(self, user): @@ -170,7 +170,7 @@ class FederatedStream(ActivityStream): def stream_users(self, status): # this stream wants no part in non-public statuses if status.privacy != "public": - return None + return [] return super().stream_users(status) def stream_statuses(self, user): From c8118c9bf458ddc183efd0879e8717ce75144504 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 26 Mar 2021 12:52:04 -0700 Subject: [PATCH 2/7] Updates activity streams tests --- bookwyrm/tests/test_activitystreams.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bookwyrm/tests/test_activitystreams.py b/bookwyrm/tests/test_activitystreams.py index d7a3d4eb6..88ca4693b 100644 --- a/bookwyrm/tests/test_activitystreams.py +++ b/bookwyrm/tests/test_activitystreams.py @@ -67,7 +67,7 @@ class Activitystreams(TestCase): ) status.mention_users.add(self.local_user) users = self.test_stream.stream_users(status) - self.assertIsNone(users) + self.assertEqual(users, []) status = models.Comment.objects.create( user=self.remote_user, @@ -167,7 +167,7 @@ class Activitystreams(TestCase): user=self.remote_user, content="hi", privacy="public" ) users = activitystreams.LocalStream().stream_users(status) - self.assertIsNone(users) + self.assertEqual(users, []) def test_localstream_stream_users_local_status(self, *_): """ get a list of users that should see a status """ @@ -184,7 +184,7 @@ class Activitystreams(TestCase): user=self.local_user, content="hi", privacy="unlisted" ) users = activitystreams.LocalStream().stream_users(status) - self.assertIsNone(users) + self.assertEqual(users, []) def test_federatedstream_stream_users(self, *_): """ get a list of users that should see a status """ @@ -201,4 +201,4 @@ class Activitystreams(TestCase): user=self.remote_user, content="hi", privacy="unlisted" ) users = activitystreams.FederatedStream().stream_users(status) - self.assertIsNone(users) + self.assertEqual(users, []) From 0ef33d2acba50a65810b84c2f658dffeb83788a4 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 27 Mar 2021 07:36:14 -0700 Subject: [PATCH 3/7] Adds shared books as a metric for recommending follows --- bookwyrm/static/css/format.css | 10 +++++++-- bookwyrm/templates/directory.html | 11 ++++++++- bookwyrm/templates/feed/feed.html | 37 +++++++++++++++++-------------- bookwyrm/views/directory.py | 16 +++---------- bookwyrm/views/feed.py | 22 ++++-------------- bookwyrm/views/helpers.py | 28 ++++++++++++++++++++++- 6 files changed, 72 insertions(+), 52 deletions(-) diff --git a/bookwyrm/static/css/format.css b/bookwyrm/static/css/format.css index c640cd273..0956517da 100644 --- a/bookwyrm/static/css/format.css +++ b/bookwyrm/static/css/format.css @@ -163,9 +163,15 @@ html { vertical-align: middle; display: inline; } -.navbar .avatar { - max-height: none; +.is-32x32 { + min-width: 32px; + min-height: 32px; } +.is-96x96 { + min-width: 96px; + min-height: 96px; +} + /* --- QUOTES --- */ diff --git a/bookwyrm/templates/directory.html b/bookwyrm/templates/directory.html index 6f8bc3e46..3d47e26bd 100644 --- a/bookwyrm/templates/directory.html +++ b/bookwyrm/templates/directory.html @@ -121,12 +121,21 @@