Skip to content

Instantly share code, notes, and snippets.

@nickvergessen
Created April 24, 2018 10:27
Show Gist options
  • Save nickvergessen/298829c25ff03c832e496a99b513e57d to your computer and use it in GitHub Desktop.
Save nickvergessen/298829c25ff03c832e496a99b513e57d to your computer and use it in GitHub Desktop.
diff --git a/js/richobjectstringparser.js b/js/richobjectstringparser.js
index 9159c1e..403d5d4 100644
--- a/js/richobjectstringparser.js
+++ b/js/richobjectstringparser.js
@@ -13,7 +13,7 @@
OCA.SpreedMe.RichObjectStringParser = {
- _userLocalTemplate: '<span class="mention-user">@{{name}}</span>',
+ _userLocalTemplate: '<span class="mention-user" data-user="{{id}}">@{{name}}</span>',
_unknownTemplate: '<strong>{{name}}</strong>',
_unknownLinkTemplate: '<a href="{{link}}">{{name}}</a>',
diff --git a/js/views/chatview.js b/js/views/chatview.js
index 6fc9448..d8a7473 100644
--- a/js/views/chatview.js
+++ b/js/views/chatview.js
@@ -375,12 +375,9 @@
},
_postRenderMessage: function($el) {
- $el.find('.avatar').each(function() {
- var avatar = $(this);
- var strong = $(this).next();
- var appendTo = $(this).parent();
-
- $.merge(avatar, strong).contactsMenu(avatar.data('user'), 0, appendTo);
+ $el.find('.mention-user').each(function() {
+ var $this = $(this);
+ $this.contactsMenu($this.data('user'), 0, $this);
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment