mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 06:34:21 +00:00
kick: use the user object
This commit is contained in:
parent
edb96f683b
commit
92a0affba1
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
|||
import {IrcEventHandler} from "../../client";
|
||||
|
||||
import Msg from "../../models/msg";
|
||||
import User from "../../models/user";
|
||||
import {MessageType} from "../../../shared/types/msg";
|
||||
import {ChanState} from "../../../shared/types/chan";
|
||||
|
||||
|
@ -15,11 +14,12 @@ export default <IrcEventHandler>function (irc, network) {
|
|||
return;
|
||||
}
|
||||
|
||||
const user = chan.getUser(data.kicked!);
|
||||
const msg = new Msg({
|
||||
type: MessageType.KICK,
|
||||
time: data.time,
|
||||
from: chan.getUser(data.nick),
|
||||
target: chan.getUser(data.kicked!),
|
||||
target: user,
|
||||
text: data.message || "",
|
||||
highlight: data.kicked === irc.user.nick,
|
||||
self: data.nick === irc.user.nick,
|
||||
|
@ -35,7 +35,7 @@ export default <IrcEventHandler>function (irc, network) {
|
|||
state: chan.state,
|
||||
});
|
||||
} else {
|
||||
chan.removeUser(msg.target as User);
|
||||
chan.removeUser(user);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue