Show More
@@ -245,7 +245,7 b' class ChangesetCommentsModel(BaseModel):' | |||
|
245 | 245 | |
|
246 | 246 | registry = get_current_registry() |
|
247 | 247 | rhodecode_plugins = getattr(registry, 'rhodecode_plugins', {}) |
|
248 | channelstream_config = rhodecode_plugins.get('channelstream') | |
|
248 | channelstream_config = rhodecode_plugins.get('channelstream', {}) | |
|
249 | 249 | msg_url = '' |
|
250 | 250 | if commit_obj: |
|
251 | 251 | msg_url = commit_comment_url |
@@ -254,7 +254,7 b' class ChangesetCommentsModel(BaseModel):' | |||
|
254 | 254 | msg_url = pr_comment_url |
|
255 | 255 | repo_name = pr_target_repo.repo_name |
|
256 | 256 | |
|
257 | if channelstream_config: | |
|
257 | if channelstream_config.get('enabled'): | |
|
258 | 258 | message = '<strong>{}</strong> {} - ' \ |
|
259 | 259 | '<a onclick="window.location=\'{}\';' \ |
|
260 | 260 | 'window.location.reload()">' \ |
@@ -262,25 +262,24 b' class ChangesetCommentsModel(BaseModel):' | |||
|
262 | 262 | message = message.format( |
|
263 | 263 | user.username, _('made a comment'), msg_url, |
|
264 | 264 | _('Refresh page')) |
|
265 | if channelstream_config: | |
|
266 | channel = '/repo${}$/pr/{}'.format( | |
|
267 |
|
|
|
268 | pull_request_id | |
|
269 |
|
|
|
270 | payload = { | |
|
271 | 'type': 'message', | |
|
272 | 'timestamp': datetime.utcnow(), | |
|
273 |
|
|
|
274 | 'exclude_users': [user.username], | |
|
275 |
|
|
|
276 |
'message': |
|
|
277 |
|
|
|
278 |
|
|
|
279 | 'topic': '/notifications' | |
|
280 | } | |
|
265 | channel = '/repo${}$/pr/{}'.format( | |
|
266 | repo_name, | |
|
267 | pull_request_id | |
|
268 | ) | |
|
269 | payload = { | |
|
270 | 'type': 'message', | |
|
271 | 'timestamp': datetime.utcnow(), | |
|
272 | 'user': 'system', | |
|
273 | 'exclude_users': [user.username], | |
|
274 | 'channel': channel, | |
|
275 | 'message': { | |
|
276 | 'message': message, | |
|
277 | 'level': 'info', | |
|
278 | 'topic': '/notifications' | |
|
281 | 279 | } |
|
282 | channelstream_request(channelstream_config, [payload], | |
|
283 | '/message', raise_exc=False) | |
|
280 | } | |
|
281 | channelstream_request(channelstream_config, [payload], | |
|
282 | '/message', raise_exc=False) | |
|
284 | 283 | |
|
285 | 284 | return comment |
|
286 | 285 |
General Comments 0
You need to be logged in to leave comments.
Login now