Skip to content

Commit

Permalink
feat(MessagesGroup): show, which server federated user belongs to
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Mar 11, 2024
1 parent eff0938 commit 32f6eb7
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/components/MessagesList/MessagesGroup/MessagesGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
</div>
<ul class="messages">
<li class="messages__author" aria-level="4">
{{ actorDisplayName }}
<div v-if="lastEditTimestamp">
{{ getLastEditor }}
</div>
<span class="messages__author-name">{{ actorDisplayName }}</span>
<span v-if="isFederatedUser" class="messages__author-server">{{ getRemoteServer }}</span>
<span v-if="lastEditTimestamp" class="messages__author-edit">{{ getLastEditor }}</span>
</li>
<Message v-for="(message, index) of messages"
:key="message.id"
Expand Down Expand Up @@ -131,6 +130,14 @@ export default {
return displayName
},

isFederatedUser() {
return this.actorType === ATTENDEE.ACTOR_TYPE.FEDERATED_USERS
},

getRemoteServer() {
return this.isFederatedUser ? '(' + this.actorId.split('@').pop() + ')' : ''
},

getLastEditor() {
if (!this.lastEditTimestamp) {
return ''
Expand Down Expand Up @@ -202,8 +209,20 @@ export default {
&__author {
display: flex;
gap: 4px;
max-width: 600px;
padding: 4px 0 0 8px;
color: var(--color-text-maxcontrast);

&-name {
flex-shrink: 0;
}

&-edit,
&-server {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
</style>

0 comments on commit 32f6eb7

Please sign in to comment.