core/presencemanager.lua

changeset 565
3a49d85cafbc
parent 563
099d8a102deb
child 615
4ae3e81513f3
equal deleted inserted replaced
563:099d8a102deb 565:3a49d85cafbc
19 19
20 20
21 21
22 local log = require "util.logger".init("presencemanager") 22 local log = require "util.logger".init("presencemanager")
23 23
24 local tostring = tostring;
25 local require = require; 24 local require = require;
26 local pairs, ipairs = pairs, ipairs; 25 local pairs, ipairs = pairs, ipairs;
27 local t_concat = table.concat; 26 local t_concat = table.concat;
28 local s_find = string.find; 27 local s_find = string.find;
29 local tonumber = tonumber; 28 local tonumber = tonumber;
120 end 119 end
121 stanza.attr.to = nil; -- reset it 120 stanza.attr.to = nil; -- reset it
122 else 121 else
123 log("error", "presence recieved from client with no roster"); 122 log("error", "presence recieved from client with no roster");
124 end 123 end
125
126 if origin.conntimetotal then
127 local session = origin;
128 origin.log("BLAH", "***********\n\n\n\n\n\n****************");
129 origin.send(st.stanza("message", { from = session.host, to=session.full_jid, type = "normal" }):body("Your login took "..tostring(session.conntimetotal).." seconds"));
130 origin.conntimetotal = nil;
131 end
132
133 end 124 end
134 125
135 function send_presence_of_available_resources(user, host, jid, recipient_session, core_route_stanza) 126 function send_presence_of_available_resources(user, host, jid, recipient_session, core_route_stanza)
136 local h = hosts[host]; 127 local h = hosts[host];
137 local count = 0; 128 local count = 0;

mercurial