~technomancy/taverner

a86534a4a27c057f8904f64ccb9db2d7e9c16c29 — Phil Hagelberg 17 days ago 7eb9eb9 main
When notifying of nick changes, send user as well.

This is not required by the spec, but if you leave it out, weechat
doesn't work for changing your own nick.
2 files changed, 3 insertions(+), 3 deletions(-)

M channel.fnl
M commands.fnl
M channel.fnl => channel.fnl +2 -2
@@ 70,12 70,12 @@
    (fn voice? [nick] (lume.find modes.v nick))
    (fn may-change-topic? [nick] (or (not (mode :t)) (op? nick)))

    (fn rename [old-nick new-nick]
    (fn rename [old-nick new-nick user]
      (when (member? old-nick)
        (let [conn (. members old-nick)]
          (tset members old-nick nil)
          (tset members new-nick conn)
          (send nil (.. ":" old-nick " NICK " new-nick "\r\n")))))
          (send nil (.. ":" old-nick "!" user " NICK " new-nick "\r\n")))))

    (fn upgrade [self new-make]
      (self.flush)

M commands.fnl => commands.fnl +1 -1
@@ 175,7 175,7 @@
  (let [old-nick cstate.nick]
    (when (valid.set state cstate :nick ?new-nick)
      (each [_ ch (pairs state.channels)]
        (ch.rename old-nick ?new-nick)))))
        (ch.rename old-nick ?new-nick cstate.user)))))

;; Don't touch this function without testing it locally! breaking reload sucks.
(fn REHASH [state cstate ?what]