mirror of
https://github.com/thelounge/thelounge
synced 2025-02-16 13:18:24 +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 "message": // fallthrough
|
||||||
|
|
||||||
case "action": {
|
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) {
|
if (user) {
|
||||||
user.lastMessage = new Date(msg.time).getTime() || Date.now();
|
user.lastMessage = new Date(msg.time).getTime() || Date.now();
|
||||||
|
@ -205,7 +205,7 @@ function updateUserList(channel: ClientChan, msg: SharedMsg) {
|
||||||
case "quit": // fallthrough
|
case "quit": // fallthrough
|
||||||
|
|
||||||
case "part": {
|
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) {
|
if (idx > -1) {
|
||||||
channel.users.splice(idx, 1);
|
channel.users.splice(idx, 1);
|
||||||
|
@ -215,7 +215,7 @@ function updateUserList(channel: ClientChan, msg: SharedMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case "kick": {
|
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) {
|
if (idx > -1) {
|
||||||
channel.users.splice(idx, 1);
|
channel.users.splice(idx, 1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue