Lots of channel related fixes and updates

This commit is contained in:
N-Pex 2024-10-11 17:04:32 +02:00
parent e3bfede77e
commit ca777a83be
17 changed files with 508 additions and 59 deletions

View file

@ -109,7 +109,7 @@ export default {
* Don't show sender and time if the next event is within 2 minutes and also from us (= back to back messages)
*/
showSenderAndTime() {
if (this.nextEvent && this.nextEvent.getSender() == this.event.getSender()) {
if (!this.event.isPinned && this.nextEvent && this.nextEvent.getSender() == this.event.getSender()) {
const ts1 = this.nextEvent.event.origin_server_ts;
const ts2 = this.event.event.origin_server_ts;
return ts1 - ts2 < 2 * 60 * 1000; // less than 2 minutes
@ -181,11 +181,15 @@ export default {
},
/**
* Classes to set for the message. Currently only for "messageIn", TODO: - detect messageIn or messageOut.
* Classes to set for the message. Currently only for "messageIn"
*/
messageClasses() {
return { messageIn: true, "from-admin": this.senderIsAdminOrModerator(this.event) };
if (this.incoming) {
return { messageIn: true, "from-admin": this.senderIsAdminOrModerator(this.event), "pinned": this.event.isPinned };
} else {
return { messageOut: true, "pinned": this.event.isPinned };
}
},
userAvatar() {