@@ -242,9 +242,10 @@ def get_item(self, id):
242
242
243
243
class CommentHandler (ItemHandler ):
244
244
def get_item (self , post_id , id ):
245
- cmt = self .source .get_comment (
246
- id , activity_id = post_id , activity_author_id = self .source .key .id ())
247
245
post = self .get_post (post_id )
246
+ cmt = self .source .get_comment (
247
+ id , activity_id = post_id , activity_author_id = self .source .key .id (),
248
+ activity = post )
248
249
if post :
249
250
originals , mentions = original_post_discovery .discover (
250
251
self .source , post , fetch_hfeed = False )
@@ -255,8 +256,9 @@ def get_item(self, post_id, id):
255
256
256
257
class LikeHandler (ItemHandler ):
257
258
def get_item (self , post_id , user_id ):
258
- like = self .source .get_like (self .source .key .string_id (), post_id , user_id )
259
259
post = self .get_post (post_id )
260
+ like = self .source .get_like (self .source .key .string_id (), post_id , user_id ,
261
+ activity = post )
260
262
if post :
261
263
originals , mentions = original_post_discovery .discover (
262
264
self .source , post , fetch_hfeed = False )
@@ -280,9 +282,9 @@ def get_title(self, obj):
280
282
281
283
class ReactionHandler (ItemHandler ):
282
284
def get_item (self , post_id , user_id , reaction_id ):
283
- reaction = self .source .gr_source .get_reaction (
284
- self .source .key .string_id (), post_id , user_id , reaction_id )
285
285
post = self .get_post (post_id )
286
+ reaction = self .source .gr_source .get_reaction (
287
+ self .source .key .string_id (), post_id , user_id , reaction_id , activity = post )
286
288
if post :
287
289
originals , mentions = original_post_discovery .discover (
288
290
self .source , post , fetch_hfeed = False )
@@ -292,13 +294,13 @@ def get_item(self, post_id, user_id, reaction_id):
292
294
293
295
class RepostHandler (ItemHandler ):
294
296
def get_item (self , post_id , share_id ):
297
+ post = self .get_post (post_id )
295
298
repost = self .source .gr_source .get_share (
296
- self .source .key .string_id (), post_id , share_id )
299
+ self .source .key .string_id (), post_id , share_id , activity = post )
297
300
# webmention receivers don't want to see their own post in their
298
301
# comments, so remove attachments before rendering.
299
302
if repost and 'attachments' in repost :
300
303
del repost ['attachments' ]
301
- post = self .get_post (post_id )
302
304
if post :
303
305
originals , mentions = original_post_discovery .discover (
304
306
self .source , post , fetch_hfeed = False )
@@ -310,7 +312,7 @@ class RsvpHandler(ItemHandler):
310
312
def get_item (self , event_id , user_id ):
311
313
event = self .source .gr_source .get_event (event_id )
312
314
rsvp = self .source .gr_source .get_rsvp (
313
- self .source .key .string_id (), event_id , user_id )
315
+ self .source .key .string_id (), event_id , user_id , event = event )
314
316
if event :
315
317
originals , mentions = original_post_discovery .discover (
316
318
self .source , event , fetch_hfeed = False )
0 commit comments