Skip to content
Snippets Groups Projects
Commit ee35b246 authored by RMidhunSuresh's avatar RMidhunSuresh
Browse files

Hide room.member tiles except join for the bot

parent f3b73b8b
No related branches found
No related tags found
No related merge requests found
import { RoomViewModel, ViewModel, RoomStatus} from "hydrogen-view-sdk";
import { RoomViewModel, ViewModel, RoomStatus, tileClassForEntry} from "hydrogen-view-sdk";
function createCustomTileClassForEntry(ownUserId: string) {
return function customTileClassForEntry(entry) {
if (entry.content?.membership === "join" && entry.sender !== ownUserId || entry.eventType !== "m.room.member") {
return tileClassForEntry(entry);
}
return undefined;
}
}
export class ChatterboxViewModel extends ViewModel {
private _roomViewModel?: typeof RoomViewModel;
......@@ -30,6 +39,7 @@ export class ChatterboxViewModel extends ViewModel {
platform: this.platform,
urlCreator: this.urlCreator,
navigation: this.navigation,
tileClassForEntry: createCustomTileClassForEntry(this._session.userId),
}));
await this._roomViewModel.load();
this.emitChange("roomViewModel");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment