mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
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.
This commit is contained in:
parent
d3ecce2d2e
commit
c8ca1dd8d0
@ -85,15 +85,15 @@ ConferenceCall.prototype._getConferenceUserRoom = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if this room member is in fact a conference bot.
|
* Check if this user ID is in fact a conference bot.
|
||||||
* @param {RoomMember} The room member to check
|
* @param {string} userId The user ID to check.
|
||||||
* @return {boolean} True if it is a conference bot.
|
* @return {boolean} True if it is a conference bot.
|
||||||
*/
|
*/
|
||||||
module.exports.isConferenceUser = function(roomMember) {
|
module.exports.isConferenceUser = function(userId) {
|
||||||
if (roomMember.userId.indexOf("@" + USER_PREFIX) !== 0) {
|
if (userId.indexOf("@" + USER_PREFIX) !== 0) {
|
||||||
return false;
|
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) {
|
if (base64part) {
|
||||||
var decoded = new Buffer(base64part, "base64").toString();
|
var decoded = new Buffer(base64part, "base64").toString();
|
||||||
// ! $STUFF : $STUFF
|
// ! $STUFF : $STUFF
|
||||||
|
Loading…
Reference in New Issue
Block a user