Add join rle to icon src util function
Signed-off-by: ajbura <ajbura@gmail.com>
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import initMatrix from '../client/initMatrix';
|
||||
|
||||
import HashIC from '../../public/res/ic/outlined/hash.svg';
|
||||
import HashGlobeIC from '../../public/res/ic/outlined/hash-globe.svg';
|
||||
import HashLockIC from '../../public/res/ic/outlined/hash-lock.svg';
|
||||
import SpaceIC from '../../public/res/ic/outlined/space.svg';
|
||||
import SpaceGlobeIC from '../../public/res/ic/outlined/space-globe.svg';
|
||||
import SpaceLockIC from '../../public/res/ic/outlined/space-lock.svg';
|
||||
|
||||
const WELL_KNOWN_URI = '/.well-known/matrix/client';
|
||||
|
||||
async function getBaseUrl(servername) {
|
||||
@@ -86,8 +93,16 @@ function hasDMWith(userId) {
|
||||
});
|
||||
}
|
||||
|
||||
function joinRuleToIconSrc(joinRule, isSpace) {
|
||||
return ({
|
||||
restricted: () => (isSpace ? SpaceIC : HashIC),
|
||||
invite: () => (isSpace ? SpaceLockIC : HashLockIC),
|
||||
public: () => (isSpace ? SpaceGlobeIC : HashGlobeIC),
|
||||
}[joinRule]?.() || null);
|
||||
}
|
||||
|
||||
export {
|
||||
getBaseUrl, getUsername, getUsernameOfRoomMember,
|
||||
isRoomAliasAvailable, getPowerLabel, parseReply,
|
||||
hasDMWith,
|
||||
hasDMWith, joinRuleToIconSrc,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user