File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -10,3 +10,10 @@ def comment_created(comment):
1010
1111class CodeCommentSystem (Component ):
1212 change_listeners = ExtensionPoint (ICodeCommentChangeListener )
13+
14+ def comment_created (self , comment ):
15+ """
16+ Emits comment_created event to all listeners.
17+ """
18+ for listener in self .change_listeners :
19+ listener .comment_created (comment )
Original file line number Diff line number Diff line change @@ -119,8 +119,7 @@ def insert_comment(db):
119119 cursor .execute (sql , values )
120120 comment_id [0 ] = db .get_last_id (cursor , 'code_comments' )
121121
122- for listener in CodeCommentSystem (self .env ).change_listeners :
123- listener .comment_created (
124- Comments (self .req , self .env ).by_id (comment_id [0 ]))
122+ CodeCommentSystem (self .env ).comment_created (
123+ Comments (self .req , self .env ).by_id (comment_id [0 ]))
125124
126125 return comment_id [0 ]
You can’t perform that action at this time.
0 commit comments