diff --git a/src/App.vue b/src/App.vue index d8428e1..84c0f93 100644 --- a/src/App.vue +++ b/src/App.vue @@ -655,6 +655,11 @@ export default { // Is the current channel a DM? return this.channel.indexOf("@") === 0; }, + currentDMPartner() { + // If you are currently in a DM channel, get the User object of your partner. + if (!this.isDM) return {}; + return this.whoMap[this.normalizeUsername(this.channel)]; + }, pageTitleUnreadPrefix() { // When the page is not focused, put count of unread DMs in the title bar. if (this.windowFocused) return ""; @@ -2122,17 +2127,16 @@ export default { } return false; }, - leaveDM() { + leaveDM(channel) { // Validate we're in a DM currently. - if (this.channel.indexOf("@") !== 0) return; + if (channel.indexOf("@") !== 0) return; this.modalConfirm({ title: "Close conversation thread", icon: "fa fa-trash", - message: "Do you want to close this chat thread? This will remove the conversation from your view, but " + + message: `Do you want to close this chat with ${channel}? This will remove the conversation from your view, but ` + "your chat partner may still have the conversation open on their device.", }).then(() => { - let channel = this.channel; this.setChannel(this.config.channels[0].ID); delete (this.channels[channel]); delete (this.directMessageHistory[channel]); @@ -2704,6 +2708,24 @@ export default { if (this.isVideoNotAllowed(user)) return 'fa-video-slash'; return 'fa-video'; }, + isUsernameOnCamera(username) { + return this.whoMap[username].video & VideoFlag.Active; + }, + webcamButtonClass(username) { + // This styles the convenient video button that appears in the header bar + // of DM threads if your chat partner is on camera. + let video = this.whoMap[username].video; + + if (!(video & VideoFlag.Active)) { + return ""; + } + + if (video & VideoFlag.NSFW) { + return "is-danger"; + } + + return "is-link"; + }, isVideoNotAllowed(user) { // Returns whether the video button to open a user's cam will be not allowed (crossed out) @@ -4665,7 +4687,7 @@ export default {
-
@@ -4675,7 +4697,7 @@ export default {
- - {{ c.name }} - - {{ c.name }} +
+
+ + {{ c.unread }} + - - {{ c.unread }} - + + {{ c.name }} + + {{ c.name }} +
+
@@ -4748,11 +4774,11 @@ export default {
+ +
- -
+ + +
+ +
+ +
- {{ channelName }} + + +
+   + +
+ + +
+ {{ channelName }} +
+
+
@@ -4783,25 +4838,17 @@ export default {
-
- - - +
- -
- -
@@ -5020,7 +5067,7 @@ export default {
Who Is Online
-
@@ -5187,4 +5234,19 @@ export default { .mention-selected { background: rgb(192, 250, 153); } + +/* Forcibly truncating long texts */ +.forcibly-truncate-wrapper { + position: relative; + overflow: hidden !important; +} +.forcibly-truncate-body { + position: absolute; + top: 0px; + left: 0px; + right: 0px; +} +.forcibly-single-line { + white-space: nowrap; +} diff --git a/src/components/AlertModal.vue b/src/components/AlertModal.vue index eaf0387..0a68271 100644 --- a/src/components/AlertModal.vue +++ b/src/components/AlertModal.vue @@ -56,7 +56,7 @@ export default {

{{ message }}

-
+