Преглед изворни кода

Merge branch 'pr/chats_open_attrs' of https://github.com/Ape/converse.js into Ape-pr/chats_open_attrs

JC Brand пре 8 година
родитељ
комит
54136a9447
2 измењених фајлова са 4 додато и 3 уклоњено
  1. 1 0
      docs/CHANGES.md
  2. 3 3
      src/converse-api.js

+ 1 - 0
docs/CHANGES.md

@@ -12,6 +12,7 @@
 - Render the login form again upon authfail. [jcbrand]
 - #486 Honor existing mam user configuration [throwaway42]
 - #749 /me will show your contact's name in the sent field [jcbrand]
+- #770 Allow setting contact attrs on chats.open [Ape]
 - #774 Browser language (fr-fr or fr) is not detected by default [jcbrand]
 - #775 Anonymous login form is a text field instead of a push button [jcbrand]
 

+ 3 - 3
src/converse-api.js

@@ -104,20 +104,20 @@
             }
         },
         'chats': {
-            'open': function (jids) {
+            'open': function (jids, attrs) {
                 var chatbox;
                 if (_.isUndefined(jids)) {
                     _converse.log("chats.open: You need to provide at least one JID", "error");
                     return null;
                 } else if (_.isString(jids)) {
                     chatbox = _converse.wrappedChatBox(
-                        _converse.chatboxes.getChatBox(jids, true).trigger('show')
+                        _converse.chatboxes.getChatBox(jids, true, attrs).trigger('show')
                     );
                     return chatbox;
                 }
                 return _.map(jids, function (jid) {
                     chatbox = _converse.wrappedChatBox(
-                        _converse.chatboxes.getChatBox(jid, true).trigger('show')
+                        _converse.chatboxes.getChatBox(jid, true, attrs).trigger('show')
                     );
                     return chatbox;
                 });