mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
feat: add announcement channels, publishing and following (#3090)
This commit is contained in:
1 parent
376afd2ad6
commit
7e4d5137f8
381 files changed
+45650
-14076
No files matched your search
@@ -120,7 +120,8 @@ export function buildChannelCandidate(
|
||||
sortWeight,
|
||||
};
|
||||
}
|
||||
case ChannelTypes.GUILD_TEXT: {
|
||||
case ChannelTypes.GUILD_TEXT:
|
||||
case ChannelTypes.GUILD_ANNOUNCEMENT: {
|
||||
if (!channel.guildId) return null;
|
||||
const guild = getGuild(channel.guildId);
|
||||
const title = channel.name ? channel.name : i18n._(UNKNOWN_CHANNEL_DESCRIPTOR);
|
||||
|
||||
@@ -142,7 +142,11 @@ function collectChannelResults(
|
||||
}
|
||||
|
||||
function isUnreadInCurrentCommunity(channel: Channel): boolean {
|
||||
if (channel.type !== ChannelTypes.GUILD_TEXT || !isChannelVisible(channel)) return false;
|
||||
if (
|
||||
(channel.type !== ChannelTypes.GUILD_TEXT && channel.type !== ChannelTypes.GUILD_ANNOUNCEMENT) ||
|
||||
!isChannelVisible(channel)
|
||||
)
|
||||
return false;
|
||||
if (UserGuildSettings.isMutedAtAnyLevel(channel.guildId ?? null, channel.id)) return false;
|
||||
if (!ReadStates.hasUnread(channel.id)) return false;
|
||||
const unreadLevel = UserGuildSettings.resolvedGuildUnreadBadgesLevel({
|
||||
|
||||
@@ -108,7 +108,12 @@ function buildForwardGroupDMCandidates(i18n: I18n): ReadonlyArray<ForwardGroupDM
|
||||
function buildForwardChannelCandidates(): ReadonlyArray<ForwardChannelCandidate> {
|
||||
const candidates: Array<ForwardChannelCandidate> = [];
|
||||
for (const channel of Channels.allChannels) {
|
||||
if (channel.type !== ChannelTypes.GUILD_TEXT && channel.type !== ChannelTypes.GUILD_VOICE) continue;
|
||||
if (
|
||||
channel.type !== ChannelTypes.GUILD_TEXT &&
|
||||
channel.type !== ChannelTypes.GUILD_ANNOUNCEMENT &&
|
||||
channel.type !== ChannelTypes.GUILD_VOICE
|
||||
)
|
||||
continue;
|
||||
const isVoice = channel.type === ChannelTypes.GUILD_VOICE;
|
||||
const requiredPermissions = isVoice ? Permissions.VIEW_CHANNEL | Permissions.CONNECT : Permissions.VIEW_CHANNEL;
|
||||
candidates.push(
|
||||
@@ -137,6 +142,7 @@ function resolveForwardFrequentItem(id: string): ForwardFrequentItem {
|
||||
case ChannelTypes.DM_PERSONAL_NOTES:
|
||||
return {id, kind: 'group_dm', score};
|
||||
case ChannelTypes.GUILD_TEXT:
|
||||
case ChannelTypes.GUILD_ANNOUNCEMENT:
|
||||
return {id, kind: 'text', score};
|
||||
case ChannelTypes.GUILD_VOICE:
|
||||
return {id, kind: 'voice', score};
|
||||
|
||||
Reference in new issue
Block a user