decord/source/modules/guild_rooms/GuildRoomStore.tsx

286 lines
8.1 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 16435
// Function ID: 16436
2026-07-29 08:29:29 +00:00
// Name: handleSelectedChannelStoreChange
2026-08-08 06:10:11 +00:00
// Dependencies: [109, 1218, 4375, 1960, 589, 13023, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-08 06:10:11 +00:00
// Module 16435 (handleSelectedChannelStoreChange)
2026-07-23 10:11:24 +00:00
import _objectWithoutProperties from "_objectWithoutProperties";
2026-07-29 08:29:29 +00:00
import fetchFingerprint from "fetchFingerprint";
import createRTCConnection from "createRTCConnection";
import handleConnectionOpen from "handleConnectionOpen";
import { Store } from "initialize";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function handleSelectedChannelStoreChange() {
2026-07-23 10:11:24 +00:00
voiceChannelId = voiceChannelId.getVoiceChannelId();
2026-07-20 16:05:17 +00:00
if (null != voiceChannelId) {
map2.delete(voiceChannelId);
2026-07-29 08:29:29 +00:00
let flag = dependencyMap3[voiceChannelId];
if (flag == null) {
flag = true;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
dependencyMap3[voiceChannelId] = flag;
2026-07-23 10:11:24 +00:00
const tmp4 = dependencyMap3;
2026-07-20 16:05:17 +00:00
}
}
function handleNoteCreateComplete(arg0) {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let closure_2 = ["users", "objects"];
let closure_3 = ["users", "objects"];
let closure_4 = ["users"];
let map = new Map();
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-29 08:29:29 +00:00
let closure_11 = [];
2026-07-20 16:05:17 +00:00
const map1 = new Map();
2026-07-29 08:29:29 +00:00
let closure_13 = {};
let closure_14 = {};
let closure_15 = {};
let c16 = null;
let closure_17 = {};
2026-07-20 16:05:17 +00:00
const map2 = new Map();
2026-07-29 08:29:29 +00:00
let c19 = false;
let closure_20 = {};
class GuildRoomStore extends Store {
}
const prototype = GuildRoomStore.prototype;
prototype["initialize"] = function initialize() {
this.waitFor(fetchFingerprint, createRTCConnection, handleConnectionOpen);
const items = [handleConnectionOpen];
this.syncWith(items, handleSelectedChannelStoreChange);
};
prototype["getRoom"] = function getRoom(channelId) {
let tmp = dependencyMap[channelId];
if (tmp == null) {
tmp = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
};
prototype["getRoomUsers"] = function getRoomUsers(channelId) {
let tmp = dependencyMap2[channelId];
if (tmp == null) {
tmp = map;
}
return tmp;
};
prototype["getRoomObjects"] = function getRoomObjects(closure_1) {
let tmp = table[closure_1];
if (tmp == null) {
tmp = map1;
}
return tmp;
};
prototype["getPendingPosition"] = function getPendingPosition() {
return c16;
};
prototype["getMediaSessionId"] = function getMediaSessionId(arg0) {
return map2.get(arg0);
};
prototype["isVisible"] = function isVisible(arg0) {
let flag = dependencyMap3[arg0];
if (flag == null) {
flag = true;
}
return flag;
};
prototype["getPendingNote"] = function getPendingNote(arg0) {
let tmp = dependencyMap4[arg0];
if (tmp == null) {
tmp = null;
}
return tmp;
};
prototype["getNotes"] = function getNotes(closure_1) {
const roomObjects = this.getRoomObjects(closure_1);
2026-08-08 06:10:11 +00:00
let value = roomObjects.get(require(13023) /* GuildRoomObjectTypes */.GuildRoomObjectTypes.NOTE);
2026-07-29 08:29:29 +00:00
if (value == null) {
value = closure_11;
}
return value;
};
2026-07-20 16:05:17 +00:00
obj = {
GUILD_ROOM_CONNECT: function handleConnect(room) {
let objects;
let users;
room = room.room;
({ users, objects } = room);
2026-07-29 08:29:29 +00:00
closure_13[room.roomId] = callback(room, closure_2);
closure_14[room.roomId] = users;
closure_15[room.roomId] = objects;
2026-07-20 16:05:17 +00:00
let tmp = null != room.guildId;
if (tmp) {
2026-07-29 08:29:29 +00:00
tmp = null != c16;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-29 08:29:29 +00:00
c16 = null;
2026-07-20 16:05:17 +00:00
}
},
GUILD_ROOM_CONNECT_FAILURE: function handleConnectFailure(roomId) {
roomId = roomId.roomId;
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[roomId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const _Map = Map;
const id = store.getId();
2026-07-23 10:11:24 +00:00
const map = new Map(dependencyMap2[roomId]);
2026-07-20 16:05:17 +00:00
map.delete(id);
2026-07-23 10:11:24 +00:00
dependencyMap2[roomId] = map;
2026-07-20 16:05:17 +00:00
}
},
GUILD_ROOM_DISCONNECT: function handleDisconnect(arg0) {
let roomId;
let userId;
({ userId, roomId } = arg0);
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[roomId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const _Map = Map;
2026-07-23 10:11:24 +00:00
const map = new Map(dependencyMap2[roomId]);
2026-07-20 16:05:17 +00:00
map.delete(userId);
2026-07-23 10:11:24 +00:00
dependencyMap2[roomId] = map;
2026-07-29 08:29:29 +00:00
let tmp9 = c19;
if (c19) {
tmp9 = userId === store.getId();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp9) {
closure_17[roomId] = true;
c19 = false;
2026-07-20 16:05:17 +00:00
}
if (userId === store.getId()) {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
}
},
GUILD_ROOM_UPDATE: function handleUpdate(room) {
let objects;
let users;
room = room.room;
({ users, objects } = room);
2026-07-29 08:29:29 +00:00
closure_13[room.roomId] = callback(room, closure_3);
closure_15[room.roomId] = objects;
2026-07-20 16:05:17 +00:00
const id = store.getId();
let value;
2026-07-29 08:29:29 +00:00
if (dependencyMap2[room.roomId] != null) {
2026-07-20 16:05:17 +00:00
value = obj.get(id);
}
2026-07-23 10:11:24 +00:00
dependencyMap2[room.roomId] = users;
2026-07-20 16:05:17 +00:00
if (null != value) {
2026-07-29 08:29:29 +00:00
if (tmp2[room.roomId] != null) {
2026-07-20 16:05:17 +00:00
const result = obj2.set(id, value);
}
}
},
GUILD_ROOM_UPDATE_FAILURE: function handleUpdateFailure(arg0) {
let originalRoom;
let originalRoomUsers;
({ originalRoom, originalRoomUsers } = arg0);
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[originalRoom.roomId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
let obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp2);
obj.background = originalRoom.background;
tmp[originalRoom.roomId] = obj;
2026-07-20 16:05:17 +00:00
const id = store.getId();
const value = originalRoomUsers.get(id);
if (null == value) {
const _Map = Map;
2026-07-23 10:11:24 +00:00
const map = new Map(dependencyMap2[originalRoom.roomId]);
2026-07-20 16:05:17 +00:00
map.delete(id);
2026-07-23 10:11:24 +00:00
dependencyMap2[originalRoom.roomId] = map;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
obj = dependencyMap2[originalRoom.roomId];
2026-07-29 08:29:29 +00:00
if (obj != null) {
2026-07-20 16:05:17 +00:00
const result = obj.set(id, value);
}
}
}
},
GUILD_ROOM_FETCH_SUCCESS: function handleFetchSuccess(room) {
room = room.room;
2026-07-29 08:29:29 +00:00
closure_13[room.roomId] = callback(room, closure_4);
closure_14[room.roomId] = room.users;
2026-07-20 16:05:17 +00:00
},
GUILD_ROOM_LOCAL_POSITION_REQUESTED: function handleLocalPositionRequested(position) {
position = position.position;
},
GUILD_ROOM_TOGGLE_LAYOUT: function handleToggleLayout(roomId) {
roomId = roomId.roomId;
2026-07-23 10:11:24 +00:00
dependencyMap3[roomId] = !dependencyMap3[roomId];
2026-07-20 16:05:17 +00:00
if (roomId.clearLayout) {
2026-07-29 08:29:29 +00:00
let c19 = true;
2026-07-20 16:05:17 +00:00
}
},
GUILD_ROOM_LOCAL_UPDATE: function handleLocalUpdate(arg0) {
let background;
let position;
let roomId;
let statusId;
let statusText;
({ roomId, background, position, statusId, statusText } = arg0);
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[roomId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const id = store.getId();
if (null != background) {
let obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp[roomId]);
obj.background = background;
tmp[roomId] = obj;
2026-07-20 16:05:17 +00:00
}
if (null != position) {
2026-07-23 10:11:24 +00:00
const value = dependencyMap2[roomId].get(id);
2026-07-20 16:05:17 +00:00
if (null != value) {
const _Map = Map;
2026-07-29 08:29:29 +00:00
const map = new Map(tmp4[roomId]);
2026-07-20 16:05:17 +00:00
obj = {};
const merged1 = Object.assign(value);
2026-07-29 08:29:29 +00:00
if (position == null) {
2026-07-20 16:05:17 +00:00
position = value.position;
}
2026-07-29 08:29:29 +00:00
obj.position = position;
if (statusId == null) {
2026-07-20 16:05:17 +00:00
statusId = value.statusId;
}
2026-07-29 08:29:29 +00:00
obj.statusId = statusId;
if (statusText == null) {
2026-07-20 16:05:17 +00:00
statusText = value.statusText;
}
2026-07-29 08:29:29 +00:00
obj.statusText = statusText;
2026-07-20 16:05:17 +00:00
const result = map.set(id, obj);
2026-07-29 08:29:29 +00:00
tmp4[roomId] = map;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj2 = dependencyMap2[roomId];
2026-07-20 16:05:17 +00:00
}
}
},
MEDIA_SESSION_JOINED: function handleMediaSessionJoined() {
const channelId = store2.getChannelId();
const mediaSessionId = store2.getMediaSessionId();
if (tmp3) {
const result = map2.set(channelId, mediaSessionId);
}
},
2026-07-21 06:55:02 +00:00
GUILD_ROOM_PENDING_NOTE_START: function handlePendingNoteStart(roomId) {
2026-07-29 08:29:29 +00:00
closure_20[roomId.roomId] = { position: null };
2026-07-21 06:55:02 +00:00
},
GUILD_ROOM_PENDING_NOTE_PLACE: function handlePendingNotePlace(roomId) {
roomId = roomId.roomId;
2026-07-29 08:29:29 +00:00
if (null == dependencyMap4[roomId]) {
2026-07-21 06:55:02 +00:00
return false;
} else {
const obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp3);
obj.position = tmp;
tmp2[roomId] = obj;
2026-07-21 06:55:02 +00:00
}
2026-07-20 16:05:17 +00:00
},
GUILD_ROOM_PENDING_NOTE_DELETE: handleNoteCreateComplete,
GUILD_ROOM_NOTE_CREATE_COMPLETE: handleNoteCreateComplete
};
2026-07-29 08:29:29 +00:00
const guildRoomStore = new GuildRoomStore(require("dispatcher"), obj);
let result = require("createRTCConnection").fileFinishedImporting("modules/guild_rooms/GuildRoomStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default guildRoomStore;
2026-07-20 16:05:17 +00:00
export const DEFAULT_ROOM = obj;