mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 03:53:08 +00:00
socket-events/msg: fix errors
This commit is contained in:
parent
1565eb8d05
commit
42ea66c343
1 changed files with 3 additions and 3 deletions
|
@ -193,7 +193,7 @@ function updateUserList(channel: ClientChan, msg: SharedMsg) {
|
|||
case "message": // fallthrough
|
||||
|
||||
case "action": {
|
||||
const user = channel.users.find((u) => u.nick === msg.from.nick);
|
||||
const user = channel.users.find((u) => u.nick === msg.from?.nick);
|
||||
|
||||
if (user) {
|
||||
user.lastMessage = new Date(msg.time).getTime() || Date.now();
|
||||
|
@ -205,7 +205,7 @@ function updateUserList(channel: ClientChan, msg: SharedMsg) {
|
|||
case "quit": // fallthrough
|
||||
|
||||
case "part": {
|
||||
const idx = channel.users.findIndex((u) => u.nick === msg.from.nick);
|
||||
const idx = channel.users.findIndex((u) => u.nick === msg.from?.nick);
|
||||
|
||||
if (idx > -1) {
|
||||
channel.users.splice(idx, 1);
|
||||
|
@ -215,7 +215,7 @@ function updateUserList(channel: ClientChan, msg: SharedMsg) {
|
|||
}
|
||||
|
||||
case "kick": {
|
||||
const idx = channel.users.findIndex((u) => u.nick === msg.target.nick);
|
||||
const idx = channel.users.findIndex((u) => u.nick === msg.target?.nick);
|
||||
|
||||
if (idx > -1) {
|
||||
channel.users.splice(idx, 1);
|
||||
|
|
Loading…
Reference in a new issue