hook_setfold("sendtochannel", fold_sendtox)
hook_setfold("sendtoclient", fold_sendtox)
hook_setfold("newuser", fold_sendtox)
+hook_setfold("nickadd", fold_sendtox)
+hook_setfold("nickdel", fold_sendtox)
+hook_setfold("nickchange", fold_sendtox)
+if not client_data then
+ client_data = {}
+end
+hook_add("nickadd", "irccloud_auth", function(hook, cl1, cl2, chan, txt)
+ client_data[txt] = {}
+end)
+hook_add("nickdel", "irccloud_auth", function(hook, cl1, cl2, chan, txt)
+ client_data[txt] = nil
+end)
+hook_add("nickchange", "irccloud_auth", function(hook, cl1, cl2, chan, txt)
+ client_data[txt] = client_data[cl1.key]
+ client_data[cl1.key] = nil
+end)
function commands.echo(client, source, command, args)
client_notice(client, "client = "..tostring(client))
// Update nickname
if(client->nick) {
+#ifdef HAS_LUA
+ admin_hook("nickchange", client, 0, 0, key);
+#endif
msg_nick(client, nickname);
sendbuf(client);
sendbuf_visible(client);
}
free(client->nick);
free(client->key);
+ } else {
+#ifdef HAS_LUA
+ admin_hook("nickadd", client, 0, 0, key);
+#endif
}
client->nick = mystrdup(nickname);
channel_part(cl, chan, NULL, NULL);
/* Remove from client_map and get rid of the pending invites */
if (cl->key) {
+#ifdef HAS_LUA
+ admin_hook("nickdel", cl, 0, 0, cl->key);
+#endif
map_unset(&client_map, cl->key, NULL);
rpl_monoffline(0, cl->key), sendbuf_monitor(cl->key, 0, 0, 0);
struct channel *chan;