implement display of sender name in chat
This commit is contained in:
@@ -181,8 +181,8 @@ export default class ChatModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
readonly getSendingData = (): [string, string, string] => {
|
readonly getSendingData = (): [string, string, string] => {
|
||||||
const senderName: string = this.settingsModel.username || "?";
|
|
||||||
const id: string = this.settingsModel.userid;
|
const id: string = this.settingsModel.userid;
|
||||||
|
const senderName: string = this.settingsModel.username || "?";
|
||||||
|
|
||||||
const allChannels: string[] = [this.id];
|
const allChannels: string[] = [this.id];
|
||||||
for (const secondaryChannel of this.info.secondaryChannels) {
|
for (const secondaryChannel of this.info.secondaryChannels) {
|
||||||
@@ -395,8 +395,8 @@ export default class ChatModel {
|
|||||||
|
|
||||||
static createChatMessage = async (
|
static createChatMessage = async (
|
||||||
channel: string,
|
channel: string,
|
||||||
sender: string,
|
|
||||||
senderId: string,
|
senderId: string,
|
||||||
|
senderName: string,
|
||||||
encryptionKey: string,
|
encryptionKey: string,
|
||||||
body: string,
|
body: string,
|
||||||
inlineReplyId?: string,
|
inlineReplyId?: string,
|
||||||
@@ -408,7 +408,7 @@ export default class ChatModel {
|
|||||||
id: v4(),
|
id: v4(),
|
||||||
|
|
||||||
channel,
|
channel,
|
||||||
sender,
|
senderName,
|
||||||
senderId,
|
senderId,
|
||||||
body,
|
body,
|
||||||
dateSent: createTimestamp(),
|
dateSent: createTimestamp(),
|
||||||
@@ -495,8 +495,8 @@ export interface ChatMessage extends ValidObject {
|
|||||||
readonly id: string;
|
readonly id: string;
|
||||||
|
|
||||||
readonly channel: string;
|
readonly channel: string;
|
||||||
readonly sender: string;
|
|
||||||
readonly senderId: string;
|
readonly senderId: string;
|
||||||
|
readonly senderName: string;
|
||||||
body: string;
|
body: string;
|
||||||
readonly dateSent: string;
|
readonly dateSent: string;
|
||||||
readonly inlineReplyId?: string;
|
readonly inlineReplyId?: string;
|
||||||
@@ -539,7 +539,7 @@ export const ChatMessageReference: ChatMessage = {
|
|||||||
id: "",
|
id: "",
|
||||||
|
|
||||||
channel: "",
|
channel: "",
|
||||||
sender: "",
|
senderName: "",
|
||||||
senderId: "",
|
senderId: "",
|
||||||
body: "",
|
body: "",
|
||||||
dateSent: "",
|
dateSent: "",
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export function ChatMessage(
|
|||||||
<div class="main tile">
|
<div class="main tile">
|
||||||
<div class="text-container">
|
<div class="text-container">
|
||||||
<span class="sender-name ellipsis">
|
<span class="sender-name ellipsis">
|
||||||
{chatMessageViewModel.sender}
|
{chatMessageViewModel.senderName}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="body"
|
class="body"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function InlineReply(chatMessageViewModel: ChatMessageViewModel) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="inline-reply" on:click={scroll}>
|
<div class="inline-reply" on:click={scroll}>
|
||||||
<span>{reply.sender}</span>
|
<span>{reply.senderId}</span>
|
||||||
<b class="ellipsis" subscribe:innerText={reply.body}></b>
|
<b class="ellipsis" subscribe:innerText={reply.body}></b>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export function ReplyPreview(
|
|||||||
return (
|
return (
|
||||||
<div class="reply-preview">
|
<div class="reply-preview">
|
||||||
<div class="surface blur">
|
<div class="surface blur">
|
||||||
<span class="secondary">{chatMessageViewModel.sender}</span>
|
<span class="secondary">{chatMessageViewModel.senderId}</span>
|
||||||
<b
|
<b
|
||||||
class="ellipsis"
|
class="ellipsis"
|
||||||
subscribe:innerText={chatMessageViewModel.body}
|
subscribe:innerText={chatMessageViewModel.body}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export function ReplyViewHeader(
|
|||||||
? ""
|
? ""
|
||||||
: coreViewModel.translations.chatPage.message.replyHeaderLabel(
|
: coreViewModel.translations.chatPage.message.replyHeaderLabel(
|
||||||
messagePageViewModel.replyViewSelectedMessage.value
|
messagePageViewModel.replyViewSelectedMessage.value
|
||||||
.sender,
|
.senderId,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
const message = React.createProxyState(
|
const message = React.createProxyState(
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export function ChatMessageInfoModal(
|
|||||||
{InfoTile(
|
{InfoTile(
|
||||||
"account_circle",
|
"account_circle",
|
||||||
coreViewModel.translations.chatPage.message.sentBy,
|
coreViewModel.translations.chatPage.message.sentBy,
|
||||||
chatMessageViewModel.sender,
|
chatMessageViewModel.senderId,
|
||||||
)}
|
)}
|
||||||
{InfoTile(
|
{InfoTile(
|
||||||
"schedule",
|
"schedule",
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ export default class ChatMessageViewModel {
|
|||||||
// data
|
// data
|
||||||
chatMessage: ChatMessage;
|
chatMessage: ChatMessage;
|
||||||
channel: string = "";
|
channel: string = "";
|
||||||
sender: string = "";
|
senderId: string = "";
|
||||||
|
senderName: string = "";
|
||||||
dateSent: string = "";
|
dateSent: string = "";
|
||||||
body: React.State<string> = new React.State("");
|
body: React.State<string> = new React.State("");
|
||||||
inlineReply: ChatMessageViewModel | undefined = undefined;
|
inlineReply: ChatMessageViewModel | undefined = undefined;
|
||||||
@@ -165,7 +166,7 @@ export default class ChatMessageViewModel {
|
|||||||
this.allReactions.set(reaction.senderId, reaction);
|
this.allReactions.set(reaction.senderId, reaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reaction.senderId != this.coreViewModel.settingsModel.username)
|
if (reaction.senderId != this.coreViewModel.settingsModel.userid)
|
||||||
return;
|
return;
|
||||||
this.userReaction.value = reaction.isDeleting
|
this.userReaction.value = reaction.isDeleting
|
||||||
? undefined
|
? undefined
|
||||||
@@ -183,7 +184,8 @@ export default class ChatMessageViewModel {
|
|||||||
// load
|
// load
|
||||||
loadData = (): void => {
|
loadData = (): void => {
|
||||||
this.channel = this.chatMessage.channel;
|
this.channel = this.chatMessage.channel;
|
||||||
this.sender = this.chatMessage.sender;
|
this.senderId = this.chatMessage.senderId;
|
||||||
|
this.senderName = this.chatMessage.senderName;
|
||||||
this.dateSent = new Date(this.chatMessage.dateSent).toLocaleString();
|
this.dateSent = new Date(this.chatMessage.dateSent).toLocaleString();
|
||||||
this.body.value = this.chatMessage.body;
|
this.body.value = this.chatMessage.body;
|
||||||
this.status.value = this.chatMessage.status;
|
this.status.value = this.chatMessage.status;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default class NotificationViewModel {
|
|||||||
messageId: message.id,
|
messageId: message.id,
|
||||||
chat,
|
chat,
|
||||||
fullChannel,
|
fullChannel,
|
||||||
sender: message.sender,
|
sender: message.senderName,
|
||||||
body: message.body,
|
body: message.body,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export default class MessagePageViewModel extends Context {
|
|||||||
this.coreViewModel,
|
this.coreViewModel,
|
||||||
this,
|
this,
|
||||||
chatMessage,
|
chatMessage,
|
||||||
chatMessage.sender ==
|
chatMessage.senderName ==
|
||||||
this.chatViewModel.settingsViewModel.username.value,
|
this.chatViewModel.settingsViewModel.username.value,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user