mirror of
https://github.com/thelounge/thelounge
synced 2024-11-14 00:07:17 +00:00
Display correct kick modes
Defining both the kicker and the target before any code touches the channel user list ensures that everything is passed to the template.
This commit is contained in:
parent
15b922595f
commit
e4c6d78762
2 changed files with 7 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
{{> ../user_name nick=from}}
|
||||
{{> ../user_name nick=from.nick mode=from.mode}}
|
||||
has kicked
|
||||
{{> ../user_name nick=target mode=""}}
|
||||
{{> ../user_name nick=target.nick mode=target.mode}}
|
||||
{{#if text}}
|
||||
<i class="part-reason">({{{parse text}}})</i>
|
||||
{{/if}}
|
||||
|
|
|
@ -11,12 +11,13 @@ module.exports = function(irc, network) {
|
|||
return;
|
||||
}
|
||||
|
||||
const user = chan.findUser(data.kicked);
|
||||
const kicker = chan.findUser(data.nick);
|
||||
const target = chan.findUser(data.kicked);
|
||||
|
||||
if (data.kicked === irc.user.nick) {
|
||||
chan.users = [];
|
||||
} else {
|
||||
chan.users = _.without(chan.users, user);
|
||||
chan.users = _.without(chan.users, target);
|
||||
}
|
||||
|
||||
client.emit("users", {
|
||||
|
@ -26,9 +27,8 @@ module.exports = function(irc, network) {
|
|||
var msg = new Msg({
|
||||
type: Msg.Type.KICK,
|
||||
time: data.time,
|
||||
mode: user.mode,
|
||||
from: data.nick,
|
||||
target: data.kicked,
|
||||
from: kicker,
|
||||
target: target,
|
||||
text: data.message || "",
|
||||
highlight: data.kicked === irc.user.nick,
|
||||
self: data.nick === irc.user.nick
|
||||
|
|
Loading…
Reference in a new issue