Comparison

net/xmppclient_listener.lua @ 333:8d15b073fdbe

session:disconnect() -> session:close() for consistency with other Lua APIs
author Matthew Wild <mwild1@gmail.com>
date Tue, 18 Nov 2008 19:44:54 +0000
parent 331:830fd67f9378
child 451:e9f269e5204e
comparison
equal deleted inserted replaced
332:51e130b5c8de 333:8d15b073fdbe
36 return true; 36 return true;
37 end 37 end
38 38
39 39
40 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'}; 40 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};
41 local function session_disconnect(session, reason) 41 local function session_close(session, reason)
42 local log = session.log or log; 42 local log = session.log or log;
43 if session.conn then 43 if session.conn then
44 if reason then 44 if reason then
45 if type(reason) == "string" then -- assume stream error 45 if type(reason) == "string" then -- assume stream error
46 log("info", "Disconnecting client, <stream:error> is: %s", reason); 46 log("info", "Disconnecting client, <stream:error> is: %s", reason);
88 session.log = log; 88 session.log = log;
89 89
90 print("Client connected"); 90 print("Client connected");
91 91
92 session.reset_stream = session_reset_stream; 92 session.reset_stream = session_reset_stream;
93 session.disconnect = session_disconnect; 93 session.close = session_close;
94 94
95 session_reset_stream(session); -- Initialise, ready for use 95 session_reset_stream(session); -- Initialise, ready for use
96 96
97 -- TODO: Below function should be session,stanza - and xmlhandlers should use :method() notation to call, 97 -- TODO: Below function should be session,stanza - and xmlhandlers should use :method() notation to call,
98 -- this will avoid the useless indirection we have atm 98 -- this will avoid the useless indirection we have atm