diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 546ebaf..3881d9a 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -873,14 +873,20 @@ def edit_comment(session, parent, comment, user, ) if REDIS: - REDIS.publish('pagure.%s' % parent.uid, json.dumps({ - id_: len(parent.comments), - 'comment_updated': text2markdown(comment.comment), - 'comment_id': comment.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'), - })) + if issue.private: + REDIS.publish('pagure.%s' % issue.uid, json.dumps({ + 'comment_updated': 'private', + 'comment_id': comment.id, + })) + else: + REDIS.publish('pagure.%s' % parent.uid, json.dumps({ + id_: len(parent.comments), + 'comment_updated': text2markdown(comment.comment), + 'comment_id': comment.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'), + })) return "Comment updated" diff --git a/pagure/static/issue_ev.js b/pagure/static/issue_ev.js index e73d91e..1dc7a37 100644 --- a/pagure/static/issue_ev.js +++ b/pagure/static/issue_ev.js @@ -200,7 +200,20 @@ private_issue = function(data, _api_issue_url, issue_uid) { }); }) } +} +private_issue_update = function(data, _api_issue_url, issue_uid) { + var _url = _api_issue_url.replace('-1', issue_uid) + + '/comment/' + data.comment_id; + $.get( _url ) + .done(function(data) { + update_comment({ + comment_updated: data.comment, + comment_id: data.id, + comment_user: data.user.name, + comment_editor: data.comment_date, + }); + }) } process_event = function( @@ -213,6 +226,10 @@ process_event = function( console.log('private issue'); private_issue(data, _api_issue_url, issue_uid) } + else if (data.comment_updated == 'private'){ + console.log('private issue updated'); + private_issue_update(data, _api_issue_url, issue_uid) + } else if (data.added_tags){ add_tags(data, _issues_url); category = 'Tag added';