Bläddra i källkod

Merge branch 'master' into converse-omemo

JC Brand 6 år sedan
förälder
incheckning
cda426bc82
5 ändrade filer med 64 tillägg och 71 borttagningar
  1. 1 0
      css/converse.css
  2. 60 68
      dist/converse.js
  3. 1 1
      src/converse-chatview.js
  4. 1 1
      src/converse-roster.js
  5. 1 1
      src/templates/chatbox_head.html

+ 1 - 0
css/converse.css

@@ -7495,6 +7495,7 @@ body.reset {
     #conversejs .chatbox .sendXMPPMessage .spoiler-hint {
     #conversejs .chatbox .sendXMPPMessage .spoiler-hint {
       width: 100%; }
       width: 100%; }
     #conversejs .chatbox .sendXMPPMessage .chat-textarea {
     #conversejs .chatbox .sendXMPPMessage .chat-textarea {
+      color: #666;
       border-top-left-radius: 0;
       border-top-left-radius: 0;
       border-top-right-radius: 0;
       border-top-right-radius: 0;
       border-bottom-right-radius: 4px;
       border-bottom-right-radius: 4px;

+ 60 - 68
dist/converse.js

@@ -36,34 +36,19 @@
 /******/ 	// define getter function for harmony exports
 /******/ 	// define getter function for harmony exports
 /******/ 	__webpack_require__.d = function(exports, name, getter) {
 /******/ 	__webpack_require__.d = function(exports, name, getter) {
 /******/ 		if(!__webpack_require__.o(exports, name)) {
 /******/ 		if(!__webpack_require__.o(exports, name)) {
-/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ 			Object.defineProperty(exports, name, {
+/******/ 				configurable: false,
+/******/ 				enumerable: true,
+/******/ 				get: getter
+/******/ 			});
 /******/ 		}
 /******/ 		}
 /******/ 	};
 /******/ 	};
 /******/
 /******/
 /******/ 	// define __esModule on exports
 /******/ 	// define __esModule on exports
 /******/ 	__webpack_require__.r = function(exports) {
 /******/ 	__webpack_require__.r = function(exports) {
-/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ 		}
 /******/ 		Object.defineProperty(exports, '__esModule', { value: true });
 /******/ 		Object.defineProperty(exports, '__esModule', { value: true });
 /******/ 	};
 /******/ 	};
 /******/
 /******/
-/******/ 	// create a fake namespace object
-/******/ 	// mode & 1: value is a module id, require it
-/******/ 	// mode & 2: merge all properties of value into the ns
-/******/ 	// mode & 4: return value when already ns object
-/******/ 	// mode & 8|1: behave like require
-/******/ 	__webpack_require__.t = function(value, mode) {
-/******/ 		if(mode & 1) value = __webpack_require__(value);
-/******/ 		if(mode & 8) return value;
-/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
-/******/ 		var ns = Object.create(null);
-/******/ 		__webpack_require__.r(ns);
-/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
-/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
-/******/ 		return ns;
-/******/ 	};
-/******/
 /******/ 	// getDefaultExport function for compatibility with non-harmony modules
 /******/ 	// getDefaultExport function for compatibility with non-harmony modules
 /******/ 	__webpack_require__.n = function(module) {
 /******/ 	__webpack_require__.n = function(module) {
 /******/ 		var getter = module && module.__esModule ?
 /******/ 		var getter = module && module.__esModule ?
@@ -2575,7 +2560,13 @@ backbone.nativeview = __webpack_require__(/*! backbone.nativeview */ "./node_mod
             if (_.isFunction(this.beforeRender)) {
             if (_.isFunction(this.beforeRender)) {
                 this.beforeRender();
                 this.beforeRender();
             }
             }
-            const new_vnode = tovnode.toVNode(parseHTMLToDOM(this.toHTML()));
+            let new_vnode;
+            if (!_.isNil(this.toHTML)) {
+                new_vnode = tovnode.toVNode(parseHTMLToDOM(this.toHTML()));
+            } else {
+                new_vnode = tovnode.toVNode(this.toDOM());
+            }
+
             new_vnode.data.hook = _.extend({
             new_vnode.data.hook = _.extend({
                create: this.updateEventListeners.bind(this),
                create: this.updateEventListeners.bind(this),
                update: this.updateEventListeners.bind(this)
                update: this.updateEventListeners.bind(this)
@@ -27154,12 +27145,13 @@ var map = {
 
 
 function webpackContext(req) {
 function webpackContext(req) {
 	var id = webpackContextResolve(req);
 	var id = webpackContextResolve(req);
-	return __webpack_require__(id);
+	var module = __webpack_require__(id);
+	return module;
 }
 }
 function webpackContextResolve(req) {
 function webpackContextResolve(req) {
 	var id = map[req];
 	var id = map[req];
 	if(!(id + 1)) { // check for number or string
 	if(!(id + 1)) { // check for number or string
-		var e = new Error("Cannot find module '" + req + "'");
+		var e = new Error('Cannot find module "' + req + '".');
 		e.code = 'MODULE_NOT_FOUND';
 		e.code = 'MODULE_NOT_FOUND';
 		throw e;
 		throw e;
 	}
 	}
@@ -59655,26 +59647,26 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
 /*! no static exports found */
 /*! no static exports found */
 /***/ (function(module, exports) {
 /***/ (function(module, exports) {
 
 
-var g;
-
-// This works in non-strict mode
-g = (function() {
-	return this;
-})();
-
-try {
-	// This works if eval is allowed (see CSP)
-	g = g || Function("return this")() || (1, eval)("this");
-} catch (e) {
-	// This works if the window reference is available
-	if (typeof window === "object") g = window;
-}
-
-// g can still be undefined, but nothing to do about it...
-// We return undefined, instead of nothing here, so it's
-// easier to handle this case. if(!global) { ...}
-
-module.exports = g;
+var g;
+
+// This works in non-strict mode
+g = (function() {
+	return this;
+})();
+
+try {
+	// This works if eval is allowed (see CSP)
+	g = g || Function("return this")() || (1, eval)("this");
+} catch (e) {
+	// This works if the window reference is available
+	if (typeof window === "object") g = window;
+}
+
+// g can still be undefined, but nothing to do about it...
+// We return undefined, instead of nothing here, so it's
+// easier to handle this case. if(!global) { ...}
+
+module.exports = g;
 
 
 
 
 /***/ }),
 /***/ }),
@@ -59686,28 +59678,28 @@ module.exports = g;
 /*! no static exports found */
 /*! no static exports found */
 /***/ (function(module, exports) {
 /***/ (function(module, exports) {
 
 
-module.exports = function(module) {
-	if (!module.webpackPolyfill) {
-		module.deprecate = function() {};
-		module.paths = [];
-		// module.parent = undefined by default
-		if (!module.children) module.children = [];
-		Object.defineProperty(module, "loaded", {
-			enumerable: true,
-			get: function() {
-				return module.l;
-			}
-		});
-		Object.defineProperty(module, "id", {
-			enumerable: true,
-			get: function() {
-				return module.i;
-			}
-		});
-		module.webpackPolyfill = 1;
-	}
-	return module;
-};
+module.exports = function(module) {
+	if (!module.webpackPolyfill) {
+		module.deprecate = function() {};
+		module.paths = [];
+		// module.parent = undefined by default
+		if (!module.children) module.children = [];
+		Object.defineProperty(module, "loaded", {
+			enumerable: true,
+			get: function() {
+				return module.l;
+			}
+		});
+		Object.defineProperty(module, "id", {
+			enumerable: true,
+			get: function() {
+				return module.i;
+			}
+		});
+		module.webpackPolyfill = 1;
+	}
+	return module;
+};
 
 
 
 
 /***/ }),
 /***/ }),
@@ -63873,7 +63865,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
         },
         },
 
 
         render() {
         render() {
-          this.el.innerHTML = tpl_chatbox_head(_.extend(this.model.toJSON(), this.model.vcard.toJSON(), {
+          this.el.innerHTML = tpl_chatbox_head(_.extend(this.model.vcard.toJSON(), this.model.toJSON(), {
             '_converse': _converse,
             '_converse': _converse,
             'info_close': __('Close this chat box')
             'info_close': __('Close this chat box')
           }));
           }));
@@ -76844,7 +76836,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
         },
         },
 
 
         getDisplayName() {
         getDisplayName() {
-          return this.vcard.get('fullname') || this.get('jid');
+          return this.get('nickname') || this.vcard.get('nickname') || this.vcard.get('fullname') || this.get('jid');
         },
         },
 
 
         getFullname() {
         getFullname() {
@@ -79707,7 +79699,7 @@ __e(o.url) +
 '" target="_blank" rel="noopener" class="user">\n                ';
 '" target="_blank" rel="noopener" class="user">\n                ';
  } ;
  } ;
 __p += '\n                        ' +
 __p += '\n                        ' +
-__e( o.fullname || o.jid ) +
+__e( o.nickname || o.fullname || o.jid ) +
 '\n                ';
 '\n                ';
  if (o.url) { ;
  if (o.url) { ;
 __p += '\n                    </a>\n                ';
 __p += '\n                    </a>\n                ';

+ 1 - 1
src/converse-chatview.js

@@ -208,8 +208,8 @@
                 render () {
                 render () {
                     this.el.innerHTML = tpl_chatbox_head(
                     this.el.innerHTML = tpl_chatbox_head(
                         _.extend(
                         _.extend(
-                            this.model.toJSON(),
                             this.model.vcard.toJSON(),
                             this.model.vcard.toJSON(),
+                            this.model.toJSON(),
                             { '_converse': _converse,
                             { '_converse': _converse,
                               'info_close': __('Close this chat box')
                               'info_close': __('Close this chat box')
                             }
                             }

+ 1 - 1
src/converse-roster.js

@@ -247,7 +247,7 @@
                 },
                 },
 
 
                 getDisplayName () {
                 getDisplayName () {
-                    return this.vcard.get('fullname') || this.get('jid');
+                    return this.get('nickname') || this.vcard.get('nickname') || this.vcard.get('fullname') || this.get('jid');
                 },
                 },
 
 
                 getFullname () {
                 getFullname () {

+ 1 - 1
src/templates/chatbox_head.html

@@ -7,7 +7,7 @@
                 {[ if (o.url) { ]}
                 {[ if (o.url) { ]}
                     <a href="{{{o.url}}}" target="_blank" rel="noopener" class="user">
                     <a href="{{{o.url}}}" target="_blank" rel="noopener" class="user">
                 {[ } ]}
                 {[ } ]}
-                        {{{ o.fullname || o.jid }}}
+                        {{{ o.nickname || o.fullname || o.jid }}}
                 {[ if (o.url) { ]}
                 {[ if (o.url) { ]}
                     </a>
                     </a>
                 {[ } ]}
                 {[ } ]}