Skip to content
Snippets Groups Projects
Commit 0ffd4821 authored by RMidhunSuresh's avatar RMidhunSuresh
Browse files

Allow configuring avatar from config

- Also don't show the letter in avatar
parent a454f867
No related branches found
No related tags found
No related merge requests found
...@@ -8,5 +8,6 @@ ...@@ -8,5 +8,6 @@
}, },
"token": "k9SL1R~GcdbjiFjC", "token": "k9SL1R~GcdbjiFjC",
"invite_user": "@botuser:matrix.midhun.dev", "invite_user": "@botuser:matrix.midhun.dev",
"encrypt_room": true "encrypt_room": true,
"avatar": "https://i.imgur.com/FD1z37K.png"
} }
...@@ -13,6 +13,8 @@ export interface IChatterboxConfig { ...@@ -13,6 +13,8 @@ export interface IChatterboxConfig {
header: IHeader; header: IHeader;
// Token needed for token-authenticated registration // Token needed for token-authenticated registration
token: string; token: string;
// URL of the image that should be used as the users avatar
avatar: string;
} }
interface IHeader { interface IHeader {
......
...@@ -5,36 +5,84 @@ class ChatterboxTextTile extends TextTile { ...@@ -5,36 +5,84 @@ class ChatterboxTextTile extends TextTile {
get displayName() { get displayName() {
return this.isOwn? "me" : super.displayName; return this.isOwn? "me" : super.displayName;
} }
get avatarLetter() {
return "";
}
avatarUrl() {
return this.isOwn? this._options.config["avatar"]: null;
}
} }
class ChatterboxImageTile extends ImageTile { class ChatterboxImageTile extends ImageTile {
get displayName() { get displayName() {
return this.isOwn? "me" : super.displayName; return this.isOwn? "me" : super.displayName;
} }
get avatarLetter() {
return "";
}
avatarUrl() {
return this.isOwn? this._options.config["avatar"]: null;
}
} }
class ChatterboxVideoTile extends VideoTile { class ChatterboxVideoTile extends VideoTile {
get displayName() { get displayName() {
return this.isOwn? "me" : super.displayName; return this.isOwn? "me" : super.displayName;
} }
get avatarLetter() {
return "";
}
avatarUrl() {
return this.isOwn? this._options.config["avatar"]: null;
}
} }
class ChatterboxFileTile extends FileTile { class ChatterboxFileTile extends FileTile {
get displayName() { get displayName() {
return this.isOwn? "me" : super.displayName; return this.isOwn? "me" : super.displayName;
} }
get avatarLetter() {
return "";
}
avatarUrl() {
return this.isOwn? this._options.config["avatar"]: null;
}
} }
class ChatterboxLocationTile extends LocationTile { class ChatterboxLocationTile extends LocationTile {
get displayName() { get displayName() {
return this.isOwn? "me" : super.displayName; return this.isOwn? "me" : super.displayName;
} }
get avatarLetter() {
return "";
}
avatarUrl() {
return this.isOwn? this._options.config["avatar"]: null;
}
} }
class ChatterboxRedactedTile extends RedactedTile { class ChatterboxRedactedTile extends RedactedTile {
get displayName() { get displayName() {
return this.isOwn? "me" : super.displayName; return this.isOwn? "me" : super.displayName;
} }
get avatarLetter() {
return "";
}
avatarUrl() {
return this._options.config["avatar"];
}
} }
// We don't want to show the (long and random) user-id in this announcement! // We don't want to show the (long and random) user-id in this announcement!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment