Add join rle to icon src util function
Signed-off-by: ajbura <ajbura@gmail.com>
This commit is contained in:
parent
76cb52878c
commit
189dc93a6e
3 changed files with 20 additions and 26 deletions
src/util
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue