Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3348297
D11146.id37449.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11146.id37449.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 2:22 PM (18 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571138
Default Alt Text
D11146.id37449.diff (1 KB)
Attached To
Mode
D11146: [lib] Update getDefaultAvatar and threadMembersWithoutAddedAshoat
Attached
Detach File
Event Timeline
Log In to Comment