diff --git a/lib/models/user.js b/lib/models/user.js index 515f0c806..a02e30c95 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -30,6 +30,7 @@ limitations under the License. * @prop {string} displayName The 'displayname' of the user if known. * @prop {string} avatarUrl The 'avatar_url' of the user if known. * @prop {string} presence The presence enum if known. + * @prop {string} presenceStatusMsg The presence status message if known. * @prop {Number} lastActiveAgo The time elapsed in ms since the user interacted * proactively with the server, or we saw a message from the user * @prop {Number} lastPresenceTs Timestamp (ms since the epoch) for when we last @@ -44,6 +45,7 @@ limitations under the License. function User(userId) { this.userId = userId; this.presence = "offline"; + this.presenceStatusMsg = null; this.displayName = userId; this.avatarUrl = null; this.lastActiveAgo = 0; @@ -95,7 +97,9 @@ User.prototype.setPresenceEvent = function(event) { this.presence = event.getContent().presence; eventsToFire.push("User.lastPresenceTs"); - + if (event.getContent().status_msg) { + this.presenceStatusMsg = event.getContent().status_msg; + } if (event.getContent().displayname) { this.displayName = event.getContent().displayname; }