Page MenuHomePhabricator

D11146.id37449.diff
No OneTemporary

D11146.id37449.diff

diff --git a/lib/shared/avatar-utils.js b/lib/shared/avatar-utils.js
--- a/lib/shared/avatar-utils.js
+++ b/lib/shared/avatar-utils.js
@@ -22,7 +22,6 @@
} from '../types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from '../types/thread-types-enum.js';
import type { UserInfos } from '../types/user-types.js';
-import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js';
import { useSelector } from '../utils/redux-utils.js';
const defaultAnonymousUserEmojiAvatar: ClientEmojiAvatar = {
@@ -248,8 +247,10 @@
function getDefaultAvatar(hashKey: string, color?: string): ClientEmojiAvatar {
let key = hashKey;
- if (key.startsWith(`${authoritativeKeyserverID()}|`)) {
- key = key.slice(`${authoritativeKeyserverID()}|`.length);
+
+ const barPosition = key.indexOf('|');
+ if (barPosition !== -1) {
+ key = key.slice(barPosition + 1);
}
const avatarIndex = stringHash(key) % defaultEmojiAvatars.length;
diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -27,6 +27,7 @@
import ashoat from '../facts/ashoat.js';
import genesis from '../facts/genesis.js';
import { useLoggedInUserInfo } from '../hooks/account-hooks.js';
+import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
import {
hasPermission,
permissionsToBitmaskHex,
@@ -243,8 +244,10 @@
if (threadInfo.community !== genesis().id) {
return threadInfo.members;
}
+ const adminID = extractKeyserverIDFromID(threadInfo.id);
+
return threadInfo.members.filter(
- member => member.id !== ashoat.id || member.role,
+ member => member.id !== adminID || member.role,
);
}

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 25, 2:04 AM (2 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2701359
Default Alt Text
D11146.id37449.diff (1 KB)

Event Timeline