A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix(permissions): gate role hierarchy on known membership (#2370)
Hampus8ebc9400cec4
diff --git a/fluxer_app/src/features/i18n/locales/ar/messages.po b/fluxer_app/src/features/i18n/locales/ar/messages.poindex a0dbf75ee..53f2b12e3 100644--- a/fluxer_app/src/features/i18n/locales/ar/messages.po+++ b/fluxer_app/src/features/i18n/locales/ar/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "نوع رسالة غير معروف"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "إذن غير معروف"diff --git a/fluxer_app/src/features/i18n/locales/bg/messages.po b/fluxer_app/src/features/i18n/locales/bg/messages.poindex af530fe0d..0355ce693 100644--- a/fluxer_app/src/features/i18n/locales/bg/messages.po+++ b/fluxer_app/src/features/i18n/locales/bg/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Неизвестен тип съобщение"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Неизвестно разрешение"diff --git a/fluxer_app/src/features/i18n/locales/cs/messages.po b/fluxer_app/src/features/i18n/locales/cs/messages.poindex 2a80b621a..e238fd4b1 100644--- a/fluxer_app/src/features/i18n/locales/cs/messages.po+++ b/fluxer_app/src/features/i18n/locales/cs/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Neznámý typ zprávy"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Neznámé oprávnění"diff --git a/fluxer_app/src/features/i18n/locales/da/messages.po b/fluxer_app/src/features/i18n/locales/da/messages.poindex 76127f73a..9f16a5b98 100644--- a/fluxer_app/src/features/i18n/locales/da/messages.po+++ b/fluxer_app/src/features/i18n/locales/da/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Ukendt meddelelsestype"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Ukendt tilladelse"diff --git a/fluxer_app/src/features/i18n/locales/de/messages.po b/fluxer_app/src/features/i18n/locales/de/messages.poindex f768239a6..25676aeb9 100644--- a/fluxer_app/src/features/i18n/locales/de/messages.po+++ b/fluxer_app/src/features/i18n/locales/de/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Unbekannter Nachrichtentyp"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Unbekannte Berechtigung"diff --git a/fluxer_app/src/features/i18n/locales/el/messages.po b/fluxer_app/src/features/i18n/locales/el/messages.poindex 4e4e253ce..d7561b809 100644--- a/fluxer_app/src/features/i18n/locales/el/messages.po+++ b/fluxer_app/src/features/i18n/locales/el/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Άγνωστος τύπος μηνύματος"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Άγνωστη άδεια"diff --git a/fluxer_app/src/features/i18n/locales/en-GB/messages.po b/fluxer_app/src/features/i18n/locales/en-GB/messages.poindex bff12f060..00d8057fd 100644--- a/fluxer_app/src/features/i18n/locales/en-GB/messages.po+++ b/fluxer_app/src/features/i18n/locales/en-GB/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Unknown message type"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Unknown permission"diff --git a/fluxer_app/src/features/i18n/locales/en-US/messages.po b/fluxer_app/src/features/i18n/locales/en-US/messages.poindex 4e1d87731..1cccd2693 100644--- a/fluxer_app/src/features/i18n/locales/en-US/messages.po+++ b/fluxer_app/src/features/i18n/locales/en-US/messages.po@@ -33878,7 +33878,7 @@ msgid "Unknown message type"msgstr "Unknown message type"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Unknown permission"diff --git a/fluxer_app/src/features/i18n/locales/es-419/messages.po b/fluxer_app/src/features/i18n/locales/es-419/messages.poindex 79a480030..4ba76f245 100644--- a/fluxer_app/src/features/i18n/locales/es-419/messages.po+++ b/fluxer_app/src/features/i18n/locales/es-419/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Tipo de mensaje desconocido"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Permiso desconocido"diff --git a/fluxer_app/src/features/i18n/locales/es-ES/messages.po b/fluxer_app/src/features/i18n/locales/es-ES/messages.poindex 48dec5769..71d54f677 100644--- a/fluxer_app/src/features/i18n/locales/es-ES/messages.po+++ b/fluxer_app/src/features/i18n/locales/es-ES/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Tipo de mensaje desconocido"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Permiso desconocido"diff --git a/fluxer_app/src/features/i18n/locales/fi/messages.po b/fluxer_app/src/features/i18n/locales/fi/messages.poindex e48623d38..7a47059df 100644--- a/fluxer_app/src/features/i18n/locales/fi/messages.po+++ b/fluxer_app/src/features/i18n/locales/fi/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Tuntematon viestityyppi"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Tuntematon käyttöoikeus"diff --git a/fluxer_app/src/features/i18n/locales/fr/messages.po b/fluxer_app/src/features/i18n/locales/fr/messages.poindex 2e57d1c59..17e9734ba 100644--- a/fluxer_app/src/features/i18n/locales/fr/messages.po+++ b/fluxer_app/src/features/i18n/locales/fr/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Type de message inconnu"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Permission inconnue"diff --git a/fluxer_app/src/features/i18n/locales/he/messages.po b/fluxer_app/src/features/i18n/locales/he/messages.poindex 12864edcb..732b98f46 100644--- a/fluxer_app/src/features/i18n/locales/he/messages.po+++ b/fluxer_app/src/features/i18n/locales/he/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "סוג הודעה לא ידוע"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "הרשאה לא ידועה"diff --git a/fluxer_app/src/features/i18n/locales/hi/messages.po b/fluxer_app/src/features/i18n/locales/hi/messages.poindex 3cab52f14..89f3cee26 100644--- a/fluxer_app/src/features/i18n/locales/hi/messages.po+++ b/fluxer_app/src/features/i18n/locales/hi/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "मैसेज का प्रकार अज्ञात है"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "अज्ञात अनुमति"diff --git a/fluxer_app/src/features/i18n/locales/hr/messages.po b/fluxer_app/src/features/i18n/locales/hr/messages.poindex 31825b836..e9e89c487 100644--- a/fluxer_app/src/features/i18n/locales/hr/messages.po+++ b/fluxer_app/src/features/i18n/locales/hr/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Nepoznata vrsta poruke"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Nepoznata dozvola"diff --git a/fluxer_app/src/features/i18n/locales/hu/messages.po b/fluxer_app/src/features/i18n/locales/hu/messages.poindex fc8a1cea9..5378b9c67 100644--- a/fluxer_app/src/features/i18n/locales/hu/messages.po+++ b/fluxer_app/src/features/i18n/locales/hu/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Ismeretlen üzenettípus"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Ismeretlen engedély"diff --git a/fluxer_app/src/features/i18n/locales/id/messages.po b/fluxer_app/src/features/i18n/locales/id/messages.poindex 048654d5e..dafe7034e 100644--- a/fluxer_app/src/features/i18n/locales/id/messages.po+++ b/fluxer_app/src/features/i18n/locales/id/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Jenis pesan tidak diketahui"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Izin tidak dikenal"diff --git a/fluxer_app/src/features/i18n/locales/it/messages.po b/fluxer_app/src/features/i18n/locales/it/messages.poindex 4b1a28072..229173a9a 100644--- a/fluxer_app/src/features/i18n/locales/it/messages.po+++ b/fluxer_app/src/features/i18n/locales/it/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Tipo di messaggio sconosciuto"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Permesso sconosciuto"diff --git a/fluxer_app/src/features/i18n/locales/ja/messages.po b/fluxer_app/src/features/i18n/locales/ja/messages.poindex 9cdc3adf9..631da6560 100644--- a/fluxer_app/src/features/i18n/locales/ja/messages.po+++ b/fluxer_app/src/features/i18n/locales/ja/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "不明なメッセージタイプ"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "不明な権限"diff --git a/fluxer_app/src/features/i18n/locales/ko/messages.po b/fluxer_app/src/features/i18n/locales/ko/messages.poindex 289ceb6cf..0f14d5d75 100644--- a/fluxer_app/src/features/i18n/locales/ko/messages.po+++ b/fluxer_app/src/features/i18n/locales/ko/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "알 수 없는 메시지 유형"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "알 수 없는 권한"diff --git a/fluxer_app/src/features/i18n/locales/lt/messages.po b/fluxer_app/src/features/i18n/locales/lt/messages.poindex eddbfdd8a..fa22f0f2d 100644--- a/fluxer_app/src/features/i18n/locales/lt/messages.po+++ b/fluxer_app/src/features/i18n/locales/lt/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Nežinomas pranešimo tipas"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Nežinomas leidimas"diff --git a/fluxer_app/src/features/i18n/locales/nl/messages.po b/fluxer_app/src/features/i18n/locales/nl/messages.poindex b94120f5b..5454fb83c 100644--- a/fluxer_app/src/features/i18n/locales/nl/messages.po+++ b/fluxer_app/src/features/i18n/locales/nl/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Onbekend berichttype"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Onbekende machtiging"diff --git a/fluxer_app/src/features/i18n/locales/no/messages.po b/fluxer_app/src/features/i18n/locales/no/messages.poindex 25867aff4..b20785b84 100644--- a/fluxer_app/src/features/i18n/locales/no/messages.po+++ b/fluxer_app/src/features/i18n/locales/no/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Ukjent meldingstype"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Ukjent tillatelse"diff --git a/fluxer_app/src/features/i18n/locales/pl/messages.po b/fluxer_app/src/features/i18n/locales/pl/messages.poindex 4d76fe72c..16f0c55c6 100644--- a/fluxer_app/src/features/i18n/locales/pl/messages.po+++ b/fluxer_app/src/features/i18n/locales/pl/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Nieznany typ wiadomości"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Nieznane uprawnienie"diff --git a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po b/fluxer_app/src/features/i18n/locales/pt-BR/messages.poindex e62d93e5f..baef20342 100644--- a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po+++ b/fluxer_app/src/features/i18n/locales/pt-BR/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Tipo de mensagem desconhecido"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Permissão desconhecida"diff --git a/fluxer_app/src/features/i18n/locales/ro/messages.po b/fluxer_app/src/features/i18n/locales/ro/messages.poindex 3c2c5a5be..bdae41cae 100644--- a/fluxer_app/src/features/i18n/locales/ro/messages.po+++ b/fluxer_app/src/features/i18n/locales/ro/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Tip de mesaj necunoscut"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Permisiune necunoscută"diff --git a/fluxer_app/src/features/i18n/locales/ru/messages.po b/fluxer_app/src/features/i18n/locales/ru/messages.poindex 34f559ac8..aa8586fd5 100644--- a/fluxer_app/src/features/i18n/locales/ru/messages.po+++ b/fluxer_app/src/features/i18n/locales/ru/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Неизвестный тип сообщения"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Неизвестное разрешение"diff --git a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po b/fluxer_app/src/features/i18n/locales/sv-SE/messages.poindex 69472df42..9c37798d1 100644--- a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po+++ b/fluxer_app/src/features/i18n/locales/sv-SE/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Okänd meddelandetyp"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Okänd behörighet"diff --git a/fluxer_app/src/features/i18n/locales/th/messages.po b/fluxer_app/src/features/i18n/locales/th/messages.poindex c1a5f111b..a0c516197 100644--- a/fluxer_app/src/features/i18n/locales/th/messages.po+++ b/fluxer_app/src/features/i18n/locales/th/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "ประเภทข้อความไม่รู้จัก"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "สิทธิ์ที่ไม่รู้จัก"diff --git a/fluxer_app/src/features/i18n/locales/tr/messages.po b/fluxer_app/src/features/i18n/locales/tr/messages.poindex d970d4df3..a6eda84b5 100644--- a/fluxer_app/src/features/i18n/locales/tr/messages.po+++ b/fluxer_app/src/features/i18n/locales/tr/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Bilinmeyen mesaj türü"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Bilinmeyen izin"diff --git a/fluxer_app/src/features/i18n/locales/uk/messages.po b/fluxer_app/src/features/i18n/locales/uk/messages.poindex f6db35eb1..e5fed9376 100644--- a/fluxer_app/src/features/i18n/locales/uk/messages.po+++ b/fluxer_app/src/features/i18n/locales/uk/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Невідомий тип повідомлення"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Невідомий дозвіл"diff --git a/fluxer_app/src/features/i18n/locales/vi/messages.po b/fluxer_app/src/features/i18n/locales/vi/messages.poindex af4c72c31..832e96355 100644--- a/fluxer_app/src/features/i18n/locales/vi/messages.po+++ b/fluxer_app/src/features/i18n/locales/vi/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "Loại tin nhắn không xác định"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "Quyền không xác định"diff --git a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po b/fluxer_app/src/features/i18n/locales/zh-CN/messages.poindex 5a0adaa77..633cc20f5 100644--- a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po+++ b/fluxer_app/src/features/i18n/locales/zh-CN/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "未知消息类型"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "未知权限"diff --git a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po b/fluxer_app/src/features/i18n/locales/zh-TW/messages.poindex d8cebd67a..4c03d141b 100644--- a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po+++ b/fluxer_app/src/features/i18n/locales/zh-TW/messages.po@@ -33877,7 +33877,7 @@ msgid "Unknown message type"msgstr "不明訊息類型"#. Fallback label for a permission bit the client does not recognize.-#: src/features/permissions/utils/PermissionUtils.ts:410+#: src/features/permissions/utils/PermissionUtils.ts:421msgid "Unknown permission"msgstr "不明權限"diff --git a/fluxer_app/src/features/member/state/GuildMembers.ts b/fluxer_app/src/features/member/state/GuildMembers.tsindex ace7756fc..d70869ffd 100644--- a/fluxer_app/src/features/member/state/GuildMembers.ts+++ b/fluxer_app/src/features/member/state/GuildMembers.ts@@ -109,6 +109,16 @@ class GuildMembers {return this.members[guildId]?.[userId] ?? null;}+ isMembershipKnown(guildId: string, userId?: string | null): boolean {+ if (!userId) {+ return false;+ }+ if (this.members[guildId]?.[userId]) {+ return true;+ }+ return this.nonMembers[guildId]?.has(userId) ?? false;+ }+isUserTimedOut(guildId: string | null, userId?: string | null): boolean {return this.getCommunicationDisabledUntil(guildId, userId) !== null;}@@ -155,6 +165,7 @@ class GuildMembers {if (!this.members[guild.id]) {this.members[guild.id] = {};}+ delete this.nonMembers[guild.id];const members = this.members[guild.id];cacheGuildMemberUsers(guild.members);for (const member of guild.members) {@@ -205,6 +216,7 @@ class GuildMembers {}handleMemberRemove(guildId: string, userId: string): void {+ this.markAsNonMember(guildId, userId);const existingMembers = this.members[guildId];if (!existingMembers) {return;@@ -277,22 +289,18 @@ class GuildMembers {return;}const returnedIds = new Set(pending.members.map((record) => record.user.id));- const notFound: Array<string> = [];for (const id of requested) {if (!returnedIds.has(id)) {- notFound.push(id);+ this.markAsNonMember(pending.guildId, id);}}- if (notFound.length === 0) {- return;- }- if (!this.nonMembers[pending.guildId]) {- this.nonMembers[pending.guildId] = new Set();- }- const cache = this.nonMembers[pending.guildId];- for (const id of notFound) {- cache.add(id);+ }++ private markAsNonMember(guildId: string, userId: string): void {+ if (!this.nonMembers[guildId]) {+ this.nonMembers[guildId] = new Set();}+ this.nonMembers[guildId].add(userId);}async fetchMembers(@@ -462,7 +470,7 @@ class GuildMembers {}const generation = this.messageMemberRequestGeneration;try {- await this.fetchMembers(guildId, {userIds, markMissingAsNonMembers: false});+ await this.fetchMembers(guildId, {userIds, markMissingAsNonMembers: true});if (generation === this.messageMemberRequestGeneration) {this.forgetPendingMessageMembers(guildId, userIds);}diff --git a/fluxer_app/src/features/permissions/hooks/useRoleHierarchy.ts b/fluxer_app/src/features/permissions/hooks/useRoleHierarchy.tsindex 13976b976..355892394 100644--- a/fluxer_app/src/features/permissions/hooks/useRoleHierarchy.ts+++ b/fluxer_app/src/features/permissions/hooks/useRoleHierarchy.ts@@ -25,9 +25,7 @@ export function useRoleHierarchy(guild: Guild | null | undefined) {if (!guild || !currentUser) return false;if (guild.isOwner(currentUser.id)) return true;if (guild.isOwner(targetUserId)) return false;- const wireGuild = guild.toJSON();- const targetHighestRole = PermissionUtils.getHighestRole(wireGuild, targetUserId);- return PermissionUtils.isRoleHigher(wireGuild, currentUser.id, currentUserHighestRole, targetHighestRole);+ return PermissionUtils.canManageTargetUser(guild.toJSON(), currentUser.id, currentUserHighestRole, targetUserId);},[guild, currentUser, currentUserHighestRole],);diff --git a/fluxer_app/src/features/permissions/state/Permission.ts b/fluxer_app/src/features/permissions/state/Permission.tsindex 4f0985bdc..6d6153e74 100644--- a/fluxer_app/src/features/permissions/state/Permission.ts+++ b/fluxer_app/src/features/permissions/state/Permission.ts@@ -82,8 +82,7 @@ class Permission {}const wireGuild = guild.toJSON();const myHighestRole = PermissionUtils.getHighestRole(wireGuild, me.id);- const otherHighestRole = PermissionUtils.getHighestRole(wireGuild, otherUserId);- return PermissionUtils.isRoleHigher(wireGuild, me.id, myHighestRole, otherHighestRole);+ return PermissionUtils.canManageTargetUser(wireGuild, me.id, myHighestRole, otherUserId);}handleGatewayReady(): void {diff --git a/fluxer_app/src/features/permissions/utils/PermissionUtils.ts b/fluxer_app/src/features/permissions/utils/PermissionUtils.tsindex d91675633..a96096e0e 100644--- a/fluxer_app/src/features/permissions/utils/PermissionUtils.ts+++ b/fluxer_app/src/features/permissions/utils/PermissionUtils.ts@@ -33,7 +33,7 @@ interface PermissionOverwrite {deny: bigint;}-interface Role {+export interface Role {id: string;permissions: bigint;position: number;@@ -192,6 +192,17 @@ export function getHighestRole(guild: Guild, userId: string): Role | null {return memberRoles[0] ?? null;}+export function canManageTargetUser(+ guild: Guild,+ userId: string,+ userHighestRole: Role | null,+ targetUserId: string,+): boolean {+ if (guild.owner_id === userId) return true;+ if (!GuildMembers.isMembershipKnown(guild.id, targetUserId)) return false;+ return isRoleHigher(guild, userId, userHighestRole, getHighestRole(guild, targetUserId));+}+export function can(permission: bigint,user: