mirror of
https://github.com/thelounge/thelounge
synced 2024-11-24 21:13:06 +00:00
fix msg event
This commit is contained in:
parent
8e6920af1d
commit
7073584f1c
2 changed files with 7 additions and 3 deletions
|
@ -123,12 +123,14 @@ function notifyMessage(
|
|||
) {
|
||||
let title: string;
|
||||
let body: string;
|
||||
// TODO: fix msg type and get rid of that conditional
|
||||
const nick = msg.from && msg.from.nick ? msg.from.nick : "unkonown";
|
||||
|
||||
if (msg.type === "invite") {
|
||||
title = "New channel invite:";
|
||||
body = msg.from.nick + " invited you to " + msg.channel;
|
||||
body = nick + " invited you to " + msg.channel;
|
||||
} else {
|
||||
title = String(msg.from.nick);
|
||||
title = nick;
|
||||
|
||||
if (channel.type !== "query") {
|
||||
title += ` (${channel.name})`;
|
||||
|
@ -138,7 +140,8 @@ function notifyMessage(
|
|||
title += " says:";
|
||||
}
|
||||
|
||||
body = cleanIrcMessage(msg.text);
|
||||
// TODO: fix msg type and get rid of that conditional
|
||||
body = cleanIrcMessage(msg.text ? msg.text : "");
|
||||
}
|
||||
|
||||
const timestamp = Date.parse(String(msg.time));
|
||||
|
|
|
@ -100,4 +100,5 @@ export type SharedMsg = {
|
|||
export type ClientMessage = Omit<SharedMsg, "users"> & {
|
||||
time: Date;
|
||||
users: string[];
|
||||
id: number;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue