From c8ca1dd8d0bc14c42284ea8288bcb19cf54d8558 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 16 Dec 2015 11:55:13 +0000 Subject: [PATCH] Pass a userId rather than a RoomMember to isConferenceUser Because invites do not have RoomMembers because we don't have an m.room.member event for them, just a user ID, and we want to detect conf users at invite time. --- src/VectorConferenceHandler.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/VectorConferenceHandler.js b/src/VectorConferenceHandler.js index 637e34f943..7628e0f5e1 100644 --- a/src/VectorConferenceHandler.js +++ b/src/VectorConferenceHandler.js @@ -85,15 +85,15 @@ ConferenceCall.prototype._getConferenceUserRoom = function() { }; /** - * Check if this room member is in fact a conference bot. - * @param {RoomMember} The room member to check + * Check if this user ID is in fact a conference bot. + * @param {string} userId The user ID to check. * @return {boolean} True if it is a conference bot. */ -module.exports.isConferenceUser = function(roomMember) { - if (roomMember.userId.indexOf("@" + USER_PREFIX) !== 0) { +module.exports.isConferenceUser = function(userId) { + if (userId.indexOf("@" + USER_PREFIX) !== 0) { return false; } - var base64part = roomMember.userId.split(":")[0].substring(1 + USER_PREFIX.length); + var base64part = userId.split(":")[0].substring(1 + USER_PREFIX.length); if (base64part) { var decoded = new Buffer(base64part, "base64").toString(); // ! $STUFF : $STUFF