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 {IrcEventHandler} from "../../client";
|
||||||
|
|
||||||
import Msg from "../../models/msg";
|
import Msg from "../../models/msg";
|
||||||
import User from "../../models/user";
|
|
||||||
import {MessageType} from "../../../shared/types/msg";
|
import {MessageType} from "../../../shared/types/msg";
|
||||||
import {ChanState} from "../../../shared/types/chan";
|
import {ChanState} from "../../../shared/types/chan";
|
||||||
|
|
||||||
|
@ -15,11 +14,12 @@ export default <IrcEventHandler>function (irc, network) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const user = chan.getUser(data.kicked!);
|
||||||
const msg = new Msg({
|
const msg = new Msg({
|
||||||
type: MessageType.KICK,
|
type: MessageType.KICK,
|
||||||
time: data.time,
|
time: data.time,
|
||||||
from: chan.getUser(data.nick),
|
from: chan.getUser(data.nick),
|
||||||
target: chan.getUser(data.kicked!),
|
target: user,
|
||||||
text: data.message || "",
|
text: data.message || "",
|
||||||
highlight: data.kicked === irc.user.nick,
|
highlight: data.kicked === irc.user.nick,
|
||||||
self: data.nick === irc.user.nick,
|
self: data.nick === irc.user.nick,
|
||||||
|
@ -35,7 +35,7 @@ export default <IrcEventHandler>function (irc, network) {
|
||||||
state: chan.state,
|
state: chan.state,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
chan.removeUser(msg.target as User);
|
chan.removeUser(user);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue