You've already forked matrix-js-sdk
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user