1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

move me || syncedmembership code into room.getmymembership

This commit is contained in:
Bruno Windels
2018-07-25 14:53:41 +02:00
parent f6fafeaafb
commit 83c6615d6e

View File

@@ -224,13 +224,19 @@ Room.prototype.getLastEventId = function() {
}; };
/** /**
* @return {string} the membership type (join | leave | invite) this room was received as during sync * @param {string} myUserId the user id for the logged in member
* @return {string} the membership type (join | leave | invite) for the logged in user
*/ */
Room.prototype.getSyncedMembership = function() { Room.prototype.getMyMembership = function(myUserId) {
if (myUserId) {
const me = this.getMember(myUserId);
if (me) {
return me.membership;
}
}
return this._syncedMembership; return this._syncedMembership;
}; };
/** /**
* Sets the membership this room was received as during sync * Sets the membership this room was received as during sync
* @param {string} membership join | leave | invite * @param {string} membership join | leave | invite