[Libreoffice-commits] online.git: kit/Kit.cpp kit/Kit.hpp loleaflet/dist

Ashod Nakashian ashod.nakashian at collabora.co.uk
Thu Jun 1 05:48:34 UTC 2017


 kit/Kit.cpp                       |    2 +-
 kit/Kit.hpp                       |    3 +--
 loleaflet/dist/toolbar/toolbar.js |    4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit a59f78b65670cf967981938fde45737dab8f2323
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed May 31 23:57:06 2017 -0400

    wsd: UserExtraInfo is a map, not array
    
    Change-Id: I64ef04c96223ee74099697cb2276307d834db329
    Reviewed-on: https://gerrit.libreoffice.org/38291
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 5415c760..0358e7f9 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1078,7 +1078,7 @@ private:
                 const auto username = itView->second.Username;
                 oss << "\"username\":\"" << username << "\",";
                 if (!itView->second.UserExtraInfo.empty())
-                    oss << itView->second.UserExtraInfo << ',';
+                    oss << "\"userextrainfo\":" << itView->second.UserExtraInfo << ",";
                 const auto readonly = itView->second.IsReadOnly;
                 oss << "\"readonly\":\"" << readonly << "\",";
                 const auto it = viewColorsMap.find(username);
diff --git a/kit/Kit.hpp b/kit/Kit.hpp
index bbaf1bba..829ab2e2 100644
--- a/kit/Kit.hpp
+++ b/kit/Kit.hpp
@@ -52,10 +52,9 @@ struct UserInfo
              const bool readonly) :
         UserId(userId),
         Username(username),
+        UserExtraInfo(userExtraInfo),
         IsReadOnly(readonly)
     {
-        if (!userExtraInfo.empty())
-            UserExtraInfo = "\"userextrainfo\":[" + userExtraInfo + ']';
     }
 
     std::string UserId;
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 90de878e..3aa8ca29 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -1568,8 +1568,8 @@ function onUseritemClicked(e) {
 function getUserItem(viewId, userName, extraInfo, color) {
 	var html = '<tr class="useritem" id="user-' + viewId + '" onclick="onUseritemClicked(event)">' +
 	             '<td class=usercolor style="background-color: ' + color  +';';
-	if (extraInfo !== undefined && 'avatar' in extraInfo[0]) {
-		html += 'top=0px ! important;"> <img src="' + extraInfo[0].avatar + '" width="32" height="32" />'
+	if (extraInfo !== undefined && extraInfo.avatar !== undefined) {
+		html += 'top=0px ! important;"> <img src="' + extraInfo.avatar + '" width="32" height="32" />'
 	}
 	else {
 		html += '">';


More information about the Libreoffice-commits mailing list