lib
This commit is contained in:
parent
4c6ef769fb
commit
c5654f9991
|
@ -2137,7 +2137,7 @@ var BDFDB = {
|
||||||
if (type) LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
|
if (type) LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
|
||||||
return BDFDB.ReactUtils.createElement(BDFDB.ModuleUtils.findByName("ChannelContextMenu"), Object.assign({}, e, {
|
return BDFDB.ReactUtils.createElement(BDFDB.ModuleUtils.findByName("ChannelContextMenu"), Object.assign({}, e, {
|
||||||
type,
|
type,
|
||||||
channel,
|
channel: channel,
|
||||||
guild: LibraryModules.GuildStore.getGuild(channel.guild_id),
|
guild: LibraryModules.GuildStore.getGuild(channel.guild_id),
|
||||||
selected: channel.id == LibraryModules.LastChannelStore.getChannelId()
|
selected: channel.id == LibraryModules.LastChannelStore.getChannelId()
|
||||||
}));
|
}));
|
||||||
|
@ -2198,6 +2198,27 @@ var BDFDB = {
|
||||||
}
|
}
|
||||||
return found;
|
return found;
|
||||||
};
|
};
|
||||||
|
BDFDB.DMUtils.openMenu = function (eleOrInfoOrId, e = BDFDB.mousePosition) {
|
||||||
|
if (!eleOrInfoOrId) return;
|
||||||
|
let id = Node.prototype.isPrototypeOf(eleOrInfoOrId) ? BDFDB.ChannelUtils.getId(eleOrInfoOrId) : (typeof eleOrInfoOrId == "object" ? eleOrInfoOrId.id : eleOrInfoOrId);
|
||||||
|
let channel = LibraryModules.ChannelStore.getChannel(id);
|
||||||
|
if (channel) {
|
||||||
|
if (channel.isMultiUserDM()) LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
|
||||||
|
return BDFDB.ReactUtils.createElement(BDFDB.ModuleUtils.findByName("FluxContainer(GroupDMContextMenu)"), Object.assign({}, e, {
|
||||||
|
channelId: channel.id,
|
||||||
|
selected: channel.id == LibraryModules.LastChannelStore.getChannelId()
|
||||||
|
}));
|
||||||
|
}, {noBlurEvent: true});
|
||||||
|
else LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
|
||||||
|
return BDFDB.ReactUtils.createElement(BDFDB.ModuleUtils.findByName("UserContextMenu"), Object.assign({}, e, {
|
||||||
|
type: BDFDB.DiscordConstants.ContextMenuTypes.USER_PRIVATE_CHANNELS,
|
||||||
|
user: LibraryModules.UserStore.getUser(channel.recipients[0]),
|
||||||
|
channelId: channel.id,
|
||||||
|
selected: channel.id == LibraryModules.LastChannelStore.getChannelId()
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
BDFDB.DMUtils.markAsRead = function (dms) {
|
BDFDB.DMUtils.markAsRead = function (dms) {
|
||||||
if (!dms) return;
|
if (!dms) return;
|
||||||
var unreadchannels = [];
|
var unreadchannels = [];
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue