Rename room variables to h

This commit is contained in:
Jon Staab
2025-10-30 15:33:34 -07:00
parent 478721d349
commit dbaa0f5d49
28 changed files with 158 additions and 158 deletions
+4 -4
View File
@@ -191,11 +191,11 @@ export const removeSpaceMembership = async (url: string) => {
return publishThunk({event, relays})
}
export const addRoomMembership = async (url: string, room: string) => {
export const addRoomMembership = async (url: string, h: string) => {
const list = get(userGroupSelections) || makeList({kind: ROOMS})
const newTags = [
["r", url],
["group", room, url],
["group", h, url],
]
const event = await addToListPublicly(list, ...newTags).reconcile(nip44EncryptToSelf)
const relays = uniq([...Router.get().FromUser().getUrls(), ...getRelayTagValues(event.tags)])
@@ -203,9 +203,9 @@ export const addRoomMembership = async (url: string, room: string) => {
return publishThunk({event, relays})
}
export const removeRoomMembership = async (url: string, room: string) => {
export const removeRoomMembership = async (url: string, h: string) => {
const list = get(userGroupSelections) || makeList({kind: ROOMS})
const pred = (t: string[]) => equals(["group", room, url], t.slice(0, 3))
const pred = (t: string[]) => equals(["group", h, url], t.slice(0, 3))
const event = await removeFromListByPredicate(list, pred).reconcile(nip44EncryptToSelf)
const relays = uniq([url, ...Router.get().FromUser().getUrls(), ...getRelayTagValues(event.tags)])