Mercurial > prosody-modules
annotate mod_ircd/verse/verse.lua @ 529:84e992f70ba3
mod_register_json: stick to one code "punctuation" style.
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Sat, 07 Jan 2012 18:11:03 +0000 |
parents | 5b3db688213d |
children |
rev | line source |
---|---|
491
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
1 package.preload['verse.plugins.presence'] = (function (...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
2 function verse.plugins.presence(stream) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
3 stream.last_presence = nil; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
4 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
5 stream:hook("presence-out", function (presence) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
6 if not presence.attr.to then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
7 stream.last_presence = presence; -- Cache non-directed presence |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
8 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
9 end, 1); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
10 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
11 function stream:resend_presence() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
12 if last_presence then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
13 stream:send(last_presence); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
14 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
15 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
16 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
17 function stream:set_status(opts) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
18 local p = verse.presence(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
19 if type(opts) == "table" then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
20 if opts.show then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
21 p:tag("show"):text(opts.show):up(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
22 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
23 if opts.prio then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
24 p:tag("priority"):text(tostring(opts.prio)):up(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
25 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
26 if opts.msg then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
27 p:tag("status"):text(opts.msg):up(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
28 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
29 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
30 -- TODO maybe use opts as prio if it's a int, |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
31 -- or as show or status if it's a string? |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
32 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
33 stream:send(p); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
34 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
35 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
36 end) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
37 package.preload['verse.plugins.groupchat'] = (function (...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
38 local events = require "events"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
39 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
40 local room_mt = {}; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
41 room_mt.__index = room_mt; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
42 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
43 local xmlns_delay = "urn:xmpp:delay"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
44 local xmlns_muc = "http://jabber.org/protocol/muc"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
45 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
46 function verse.plugins.groupchat(stream) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
47 stream:add_plugin("presence") |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
48 stream.rooms = {}; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
49 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
50 stream:hook("stanza", function (stanza) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
51 local room_jid = jid.bare(stanza.attr.from); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
52 if not room_jid then return end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
53 local room = stream.rooms[room_jid] |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
54 if not room and stanza.attr.to and room_jid then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
55 room = stream.rooms[stanza.attr.to.." "..room_jid] |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
56 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
57 if room and room.opts.source and stanza.attr.to ~= room.opts.source then return end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
58 if room then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
59 local nick = select(3, jid.split(stanza.attr.from)); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
60 local body = stanza:get_child_text("body"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
61 local delay = stanza:get_child("delay", xmlns_delay); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
62 local event = { |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
63 room_jid = room_jid; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
64 room = room; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
65 sender = room.occupants[nick]; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
66 nick = nick; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
67 body = body; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
68 stanza = stanza; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
69 delay = (delay and delay.attr.stamp); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
70 }; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
71 local ret = room:event(stanza.name, event); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
72 return ret or (stanza.name == "message") or nil; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
73 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
74 end, 500); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
75 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
76 function stream:join_room(jid, nick, opts) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
77 if not nick then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
78 return false, "no nickname supplied" |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
79 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
80 opts = opts or {}; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
81 local room = setmetatable({ |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
82 stream = stream, jid = jid, nick = nick, |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
83 subject = nil, |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
84 occupants = {}, |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
85 opts = opts, |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
86 events = events.new() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
87 }, room_mt); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
88 if opts.source then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
89 self.rooms[opts.source.." "..jid] = room; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
90 else |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
91 self.rooms[jid] = room; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
92 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
93 local occupants = room.occupants; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
94 room:hook("presence", function (presence) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
95 local nick = presence.nick or nick; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
96 if not occupants[nick] and presence.stanza.attr.type ~= "unavailable" then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
97 occupants[nick] = { |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
98 nick = nick; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
99 jid = presence.stanza.attr.from; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
100 presence = presence.stanza; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
101 }; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
102 local x = presence.stanza:get_child("x", xmlns_muc .. "#user"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
103 if x then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
104 local x_item = x:get_child("item"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
105 if x_item and x_item.attr then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
106 occupants[nick].real_jid = x_item.attr.jid; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
107 occupants[nick].affiliation = x_item.attr.affiliation; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
108 occupants[nick].role = x_item.attr.role; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
109 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
110 --TODO Check for status 100? |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
111 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
112 if nick == room.nick then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
113 room.stream:event("groupchat/joined", room); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
114 else |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
115 room:event("occupant-joined", occupants[nick]); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
116 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
117 elseif occupants[nick] and presence.stanza.attr.type == "unavailable" then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
118 if nick == room.nick then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
119 room.stream:event("groupchat/left", room); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
120 if room.opts.source then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
121 self.rooms[room.opts.source.." "..jid] = nil; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
122 else |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
123 self.rooms[jid] = nil; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
124 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
125 else |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
126 occupants[nick].presence = presence.stanza; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
127 room:event("occupant-left", occupants[nick]); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
128 occupants[nick] = nil; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
129 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
130 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
131 end); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
132 room:hook("message", function(event) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
133 local subject = event.stanza:get_child_text("subject"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
134 if not subject then return end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
135 subject = #subject > 0 and subject or nil; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
136 if subject ~= room.subject then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
137 local old_subject = room.subject; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
138 room.subject = subject; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
139 return room:event("subject-changed", { from = old_subject, to = subject, by = event.sender, event = event }); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
140 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
141 end, 2000); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
142 local join_st = verse.presence():tag("x",{xmlns = xmlns_muc}):reset(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
143 self:event("pre-groupchat/joining", join_st); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
144 room:send(join_st) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
145 self:event("groupchat/joining", room); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
146 return room; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
147 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
148 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
149 stream:hook("presence-out", function(presence) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
150 if not presence.attr.to then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
151 for _, room in pairs(stream.rooms) do |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
152 room:send(presence); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
153 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
154 presence.attr.to = nil; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
155 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
156 end); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
157 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
158 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
159 function room_mt:send(stanza) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
160 if stanza.name == "message" and not stanza.attr.type then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
161 stanza.attr.type = "groupchat"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
162 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
163 if stanza.name == "presence" then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
164 stanza.attr.to = self.jid .."/"..self.nick; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
165 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
166 if stanza.attr.type == "groupchat" or not stanza.attr.to then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
167 stanza.attr.to = self.jid; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
168 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
169 if self.opts.source then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
170 stanza.attr.from = self.opts.source |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
171 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
172 self.stream:send(stanza); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
173 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
174 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
175 function room_mt:send_message(text) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
176 self:send(verse.message():tag("body"):text(text)); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
177 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
178 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
179 function room_mt:set_subject(text) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
180 self:send(verse.message():tag("subject"):text(text)); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
181 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
182 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
183 function room_mt:change_nick(new) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
184 self.nick = new; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
185 self:send(verse.presence()); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
186 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
187 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
188 function room_mt:leave(message) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
189 self.stream:event("groupchat/leaving", self); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
190 self:send(verse.presence({type="unavailable"})); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
191 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
192 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
193 function room_mt:admin_set(nick, what, value, reason) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
194 self:send(verse.iq({type="set"}) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
195 :query(xmlns_muc .. "#admin") |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
196 :tag("item", {nick = nick, [what] = value}) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
197 :tag("reason"):text(reason or "")); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
198 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
199 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
200 function room_mt:set_role(nick, role, reason) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
201 self:admin_set(nick, "role", role, reason); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
202 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
203 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
204 function room_mt:set_affiliation(nick, affiliation, reason) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
205 self:admin_set(nick, "affiliation", affiliation, reason); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
206 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
207 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
208 function room_mt:kick(nick, reason) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
209 self:set_role(nick, "none", reason); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
210 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
211 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
212 function room_mt:ban(nick, reason) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
213 self:set_affiliation(nick, "outcast", reason); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
214 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
215 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
216 function room_mt:event(name, arg) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
217 self.stream:debug("Firing room event: %s", name); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
218 return self.events.fire_event(name, arg); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
219 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
220 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
221 function room_mt:hook(name, callback, priority) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
222 return self.events.add_handler(name, callback, priority); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
223 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
224 end) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
225 package.preload['verse.component'] = (function (...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
226 local verse = require "verse"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
227 local stream = verse.stream_mt; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
228 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
229 local jid_split = require "util.jid".split; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
230 local lxp = require "lxp"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
231 local st = require "util.stanza"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
232 local sha1 = require "util.sha1".sha1; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
233 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
234 -- Shortcuts to save having to load util.stanza |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
235 verse.message, verse.presence, verse.iq, verse.stanza, verse.reply, verse.error_reply = |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
236 st.message, st.presence, st.iq, st.stanza, st.reply, st.error_reply; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
237 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
238 local new_xmpp_stream = require "util.xmppstream".new; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
239 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
240 local xmlns_stream = "http://etherx.jabber.org/streams"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
241 local xmlns_component = "jabber:component:accept"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
242 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
243 local stream_callbacks = { |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
244 stream_ns = xmlns_stream, |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
245 stream_tag = "stream", |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
246 default_ns = xmlns_component }; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
247 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
248 function stream_callbacks.streamopened(stream, attr) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
249 stream.stream_id = attr.id; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
250 if not stream:event("opened", attr) then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
251 stream.notopen = nil; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
252 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
253 return true; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
254 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
255 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
256 function stream_callbacks.streamclosed(stream) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
257 return stream:event("closed"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
258 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
259 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
260 function stream_callbacks.handlestanza(stream, stanza) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
261 if stanza.attr.xmlns == xmlns_stream then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
262 return stream:event("stream-"..stanza.name, stanza); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
263 elseif stanza.attr.xmlns or stanza.name == "handshake" then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
264 return stream:event("stream/"..(stanza.attr.xmlns or xmlns_component), stanza); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
265 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
266 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
267 return stream:event("stanza", stanza); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
268 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
269 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
270 function stream:reset() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
271 if self.stream then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
272 self.stream:reset(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
273 else |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
274 self.stream = new_xmpp_stream(self, stream_callbacks); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
275 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
276 self.notopen = true; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
277 return true; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
278 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
279 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
280 function stream:connect_component(jid, pass) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
281 self.jid, self.password = jid, pass; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
282 self.username, self.host, self.resource = jid_split(jid); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
283 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
284 function self.data(conn, data) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
285 local ok, err = self.stream:feed(data); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
286 if ok then return; end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
287 stream:debug("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " ")); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
288 stream:close("xml-not-well-formed"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
289 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
290 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
291 self:hook("incoming-raw", function (data) return self.data(self.conn, data); end); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
292 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
293 self.curr_id = 0; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
294 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
295 self.tracked_iqs = {}; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
296 self:hook("stanza", function (stanza) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
297 local id, type = stanza.attr.id, stanza.attr.type; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
298 if id and stanza.name == "iq" and (type == "result" or type == "error") and self.tracked_iqs[id] then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
299 self.tracked_iqs[id](stanza); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
300 self.tracked_iqs[id] = nil; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
301 return true; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
302 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
303 end); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
304 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
305 self:hook("stanza", function (stanza) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
306 if stanza.attr.xmlns == nil or stanza.attr.xmlns == "jabber:client" then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
307 if stanza.name == "iq" and (stanza.attr.type == "get" or stanza.attr.type == "set") then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
308 local xmlns = stanza.tags[1] and stanza.tags[1].attr.xmlns; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
309 if xmlns then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
310 ret = self:event("iq/"..xmlns, stanza); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
311 if not ret then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
312 ret = self:event("iq", stanza); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
313 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
314 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
315 if ret == nil then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
316 self:send(verse.error_reply(stanza, "cancel", "service-unavailable")); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
317 return true; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
318 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
319 else |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
320 ret = self:event(stanza.name, stanza); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
321 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
322 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
323 return ret; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
324 end, -1); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
325 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
326 self:hook("opened", function (attr) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
327 print(self.jid, self.stream_id, attr.id); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
328 local token = sha1(self.stream_id..pass, true); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
329 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
330 self:send(st.stanza("handshake", { xmlns = xmlns_component }):text(token)); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
331 self:hook("stream/"..xmlns_component, function (stanza) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
332 if stanza.name == "handshake" then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
333 self:event("authentication-success"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
334 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
335 end); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
336 end); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
337 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
338 local function stream_ready() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
339 self:event("ready"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
340 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
341 self:hook("authentication-success", stream_ready, -1); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
342 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
343 -- Initialise connection |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
344 self:connect(self.connect_host or self.host, self.connect_port or 5347); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
345 self:reopen(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
346 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
347 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
348 function stream:reopen() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
349 self:reset(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
350 self:send(st.stanza("stream:stream", { to = self.host, ["xmlns:stream"]='http://etherx.jabber.org/streams', |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
351 xmlns = xmlns_component, version = "1.0" }):top_tag()); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
352 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
353 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
354 function stream:close(reason) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
355 if not self.notopen then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
356 self:send("</stream:stream>"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
357 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
358 local on_disconnect = self.conn.disconnect(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
359 self.conn:close(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
360 on_disconnect(conn, reason); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
361 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
362 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
363 function stream:send_iq(iq, callback) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
364 local id = self:new_id(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
365 self.tracked_iqs[id] = callback; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
366 iq.attr.id = id; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
367 self:send(iq); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
368 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
369 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
370 function stream:new_id() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
371 self.curr_id = self.curr_id + 1; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
372 return tostring(self.curr_id); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
373 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
374 end) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
375 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
376 -- Use LuaRocks if available |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
377 pcall(require, "luarocks.require"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
378 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
379 -- Load LuaSec if available |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
380 pcall(require, "ssl"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
381 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
382 local server = require "net.server"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
383 local events = require "util.events"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
384 local logger = require "util.logger"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
385 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
386 module("verse", package.seeall); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
387 local verse = _M; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
388 _M.server = server; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
389 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
390 local stream = {}; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
391 stream.__index = stream; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
392 stream_mt = stream; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
393 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
394 verse.plugins = {}; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
395 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
396 local max_id = 0; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
397 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
398 function verse.new(logger, base) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
399 local t = setmetatable(base or {}, stream); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
400 max_id = max_id + 1; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
401 t.id = tostring(max_id); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
402 t.logger = logger or verse.new_logger("stream"..t.id); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
403 t.events = events.new(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
404 t.plugins = {}; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
405 t.verse = verse; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
406 return t; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
407 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
408 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
409 verse.add_task = require "util.timer".add_task; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
410 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
411 verse.logger = logger.init; -- COMPAT: Deprecated |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
412 verse.new_logger = logger.init; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
413 verse.log = verse.logger("verse"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
414 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
415 local function format(format, ...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
416 local n, arg, maxn = 0, { ... }, select('#', ...); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
417 return (format:gsub("%%(.)", function (c) if n <= maxn then n = n + 1; return tostring(arg[n]); end end)); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
418 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
419 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
420 function verse.set_log_handler(log_handler, levels) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
421 levels = levels or { "debug", "info", "warn", "error" }; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
422 logger.reset(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
423 local function _log_handler(name, level, message, ...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
424 return log_handler(name, level, format(message, ...)); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
425 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
426 if log_handler then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
427 for i, level in ipairs(levels) do |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
428 logger.add_level_sink(level, _log_handler); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
429 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
430 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
431 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
432 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
433 function _default_log_handler(name, level, message) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
434 return io.stderr:write(name, "\t", level, "\t", message, "\n"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
435 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
436 verse.set_log_handler(_default_log_handler, { "error" }); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
437 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
438 local function error_handler(err) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
439 verse.log("error", "Error: %s", err); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
440 verse.log("error", "Traceback: %s", debug.traceback()); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
441 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
442 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
443 function verse.set_error_handler(new_error_handler) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
444 error_handler = new_error_handler; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
445 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
446 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
447 function verse.loop() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
448 return xpcall(server.loop, error_handler); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
449 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
450 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
451 function verse.step() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
452 return xpcall(server.step, error_handler); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
453 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
454 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
455 function verse.quit() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
456 return server.setquitting(true); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
457 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
458 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
459 function stream:connect(connect_host, connect_port) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
460 connect_host = connect_host or "localhost"; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
461 connect_port = tonumber(connect_port) or 5222; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
462 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
463 -- Create and initiate connection |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
464 local conn = socket.tcp() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
465 conn:settimeout(0); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
466 local success, err = conn:connect(connect_host, connect_port); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
467 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
468 if not success and err ~= "timeout" then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
469 self:warn("connect() to %s:%d failed: %s", connect_host, connect_port, err); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
470 return self:event("disconnected", { reason = err }) or false, err; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
471 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
472 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
473 local conn = server.wrapclient(conn, connect_host, connect_port, new_listener(self), "*a"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
474 if not conn then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
475 self:warn("connection initialisation failed: %s", err); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
476 return self:event("disconnected", { reason = err }) or false, err; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
477 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
478 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
479 self.conn = conn; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
480 self.send = function (stream, data) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
481 self:event("outgoing", data); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
482 data = tostring(data); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
483 self:event("outgoing-raw", data); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
484 return conn:write(data); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
485 end; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
486 return true; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
487 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
488 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
489 function stream:close() |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
490 if not self.conn then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
491 verse.log("error", "Attempt to close disconnected connection - possibly a bug"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
492 return; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
493 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
494 local on_disconnect = self.conn.disconnect(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
495 self.conn:close(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
496 on_disconnect(conn, reason); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
497 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
498 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
499 -- Logging functions |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
500 function stream:debug(...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
501 return self.logger("debug", ...); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
502 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
503 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
504 function stream:warn(...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
505 return self.logger("warn", ...); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
506 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
507 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
508 function stream:error(...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
509 return self.logger("error", ...); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
510 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
511 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
512 -- Event handling |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
513 function stream:event(name, ...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
514 self:debug("Firing event: "..tostring(name)); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
515 return self.events.fire_event(name, ...); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
516 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
517 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
518 function stream:hook(name, ...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
519 return self.events.add_handler(name, ...); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
520 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
521 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
522 function stream:unhook(name, handler) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
523 return self.events.remove_handler(name, handler); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
524 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
525 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
526 function verse.eventable(object) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
527 object.events = events.new(); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
528 object.hook, object.unhook = stream.hook, stream.unhook; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
529 local fire_event = object.events.fire_event; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
530 function object:event(name, ...) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
531 return fire_event(name, ...); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
532 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
533 return object; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
534 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
535 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
536 function stream:add_plugin(name) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
537 if self.plugins[name] then return true; end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
538 if require("verse.plugins."..name) then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
539 local ok, err = verse.plugins[name](self); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
540 if ok ~= false then |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
541 self:debug("Loaded %s plugin", name); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
542 self.plugins[name] = true; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
543 else |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
544 self:warn("Failed to load %s plugin: %s", name, err); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
545 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
546 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
547 return self; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
548 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
549 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
550 -- Listener factory |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
551 function new_listener(stream) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
552 local conn_listener = {}; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
553 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
554 function conn_listener.onconnect(conn) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
555 stream.connected = true; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
556 stream:event("connected"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
557 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
558 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
559 function conn_listener.onincoming(conn, data) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
560 stream:event("incoming-raw", data); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
561 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
562 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
563 function conn_listener.ondisconnect(conn, err) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
564 stream.connected = false; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
565 stream:event("disconnected", { reason = err }); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
566 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
567 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
568 function conn_listener.ondrain(conn) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
569 stream:event("drained"); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
570 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
571 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
572 function conn_listener.onstatus(conn, new_status) |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
573 stream:event("status", new_status); |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
574 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
575 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
576 return conn_listener; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
577 end |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
578 |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
579 return verse; |
5b3db688213d
mod_ircd: Fixed nick change logic (thanks mva), so that the self nick-change "flag" is removed properly, improved the logic to use verse's room_mt:change_nick (thanks Zash) yet to be pushed into main, added squished verse with the meta method included.
Marco Cirillo <maranda@lightwitch.org>
parents:
diff
changeset
|
580 |