From 3d167a9e00aab4317bd08dc357ccd2fec7aff82b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 24 2015 09:22:04 +0000 Subject: Provide some more and correct information via REDIS for the SSE client --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 97ad254..a768c4a 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -812,9 +812,10 @@ def add_pull_request_comment(session, request, commit, filename, row, # Send notification for the event-source server if REDIS: REDIS.publish('pagure.%s' % request.uid, json.dumps({ - 'request_id': len(request.comments), + 'request_id': request.id, 'comment_added': text2markdown(pr_comment.comment), 'comment_user': pr_comment.user.user, + 'comment_id': pr_comment.id, 'avatar_url': avatar_url(pr_comment.user.user, size=16), 'comment_date': pr_comment.date_created.strftime('%Y-%m-%d %H:%M'), 'commit_id': commit, @@ -884,6 +885,7 @@ def edit_comment(session, parent, comment, user, id_: len(parent.comments), 'comment_updated': text2markdown(comment.comment), 'comment_id': comment.id, + 'parent_id': comment.parent.id, 'comment_editor': user_obj.user, 'avatar_url': avatar_url(comment.user.user, size=16), 'comment_date': comment.edited_on.strftime('%Y-%m-%d %H:%M:%S'),