[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/src

Jan Holesovsky kendy at collabora.com
Thu Jun 1 20:06:41 UTC 2017


 loleaflet/src/layer/AnnotationManager.js |    6 +++---
 loleaflet/src/map/Map.js                 |    4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 3bde3aa717d565b72c67f4e0111fa7d2ca62ff62
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Jun 1 21:56:21 2017 +0200

    loleaflet: Many of the WOPI impls. do not provide avatars yet.
    
    Change-Id: If72a6be9102cb96fe1a6b31f85c0e47bb0622558
    Reviewed-on: https://gerrit.libreoffice.org/38333
    Reviewed-by: Aron Budea <aron.budea at collabora.com>
    Tested-by: Aron Budea <aron.budea at collabora.com>

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 6adb5cad..4b6b3843 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -122,7 +122,7 @@ L.AnnotationManager = L.Class.extend({
 		for (var index in comments) {
 			comment = comments[index];
 			this.adjustComment(comment);
-			if (this._map._viewInfoByUser[comment.author]) {
+			if (comment.author in this._map._viewInfoByUser) {
 				comment.avatar = this._map._viewInfoByUser[comment.author].userextrainfo.avatar;
 			}
 			this._items.push(L.annotation(this._map.options.maxBounds.getSouthEast(), comment).addTo(this._map));
@@ -142,7 +142,7 @@ L.AnnotationManager = L.Class.extend({
 				// something wrong in this redline, skip this one
 				continue;
 			}
-			if (this._map._viewInfoByUser[changecomment.author]) {
+			if (changecomment.author in this._map._viewInfoByUser) {
 				changecomment.avatar = this._map._viewInfoByUser[changecomment.author].userextrainfo.avatar;
 			}
 			this._items.push(L.annotation(this._map.options.maxBounds.getSouthEast(), changecomment).addTo(this._map));
@@ -510,7 +510,7 @@ L.AnnotationManager = L.Class.extend({
 		var id;
 		var changetrack = obj.redline ? true : false;
 		var action = changetrack ? obj.redline.action : obj.comment.action;
-		if (this._map._viewInfoByUser[obj.comment.author]) {
+		if (obj.comment.author in this._map._viewInfoByUser) {
 			obj.comment.avatar = this._map._viewInfoByUser[obj.comment.author].userextrainfo.avatar;
 		}
 
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 5d8fae67..0dc0f056 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -161,7 +161,9 @@ L.Map = L.Evented.extend({
 
 	addView: function(viewInfo) {
 		this._viewInfo[viewInfo.id] = viewInfo;
-		this._viewInfoByUser[viewInfo.userid] = viewInfo;
+		if (viewInfo.userextrainfo !== undefined && viewInfo.userextrainfo.avatar !== undefined) {
+			this._viewInfoByUser[viewInfo.userid] = viewInfo;
+		}
 		this.fire('postMessage', {msgId: 'View_Added', args: {ViewId: viewInfo.id, UserId: viewInfo.userid, UserName: viewInfo.username, UserExtraInfo: viewInfo.userextrainfo, Color: viewInfo.color, ReadOnly: viewInfo.readonly}});
 
 		// Fire last, otherwise not all events are handled correctly.


More information about the Libreoffice-commits mailing list