Software /
code /
prosody
Comparison
util/muc.lua @ 1170:4845372a2c03
util.muc: Made internal methods local
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 16 May 2009 03:55:53 +0500 |
parent | 1145:06051191913d |
child | 1349:1d6c4a6c75e5 |
comparison
equal
deleted
inserted
replaced
1169:fdc68aec1d49 | 1170:4845372a2c03 |
---|---|
116 stanza.attr.to = jid; | 116 stanza.attr.to = jid; |
117 room:route_stanza(stanza); | 117 room:route_stanza(stanza); |
118 end | 118 end |
119 end | 119 end |
120 end | 120 end |
121 function room_broadcast_message(room, stanza, historic) | 121 local function room_broadcast_message(room, stanza, historic) |
122 for occupant, o_data in pairs(room._participants) do | 122 for occupant, o_data in pairs(room._participants) do |
123 for jid in pairs(o_data.sessions) do | 123 for jid in pairs(o_data.sessions) do |
124 stanza.attr.to = jid; | 124 stanza.attr.to = jid; |
125 room:route_stanza(stanza); | 125 room:route_stanza(stanza); |
126 end | 126 end |
147 :tag("item", {affiliation=o_data.affiliation, role=o_data.role}):up(); | 147 :tag("item", {affiliation=o_data.affiliation, role=o_data.role}):up(); |
148 room:route_stanza(pres); | 148 room:route_stanza(pres); |
149 end | 149 end |
150 end | 150 end |
151 end | 151 end |
152 function send_history(room, to) | 152 local function room_send_history(room, to) |
153 local history = room._data['history']; -- send discussion history | 153 local history = room._data['history']; -- send discussion history |
154 if history then | 154 if history then |
155 for _, msg in ipairs(history) do | 155 for _, msg in ipairs(history) do |
156 msg = st.deserialize(msg); | 156 msg = st.deserialize(msg); |
157 msg.attr.to=to; | 157 msg.attr.to=to; |
354 function new_room(jid) | 354 function new_room(jid) |
355 return { | 355 return { |
356 jid = jid; | 356 jid = jid; |
357 handle_stanza = room_handle_stanza; | 357 handle_stanza = room_handle_stanza; |
358 set_subject = room_set_subject; | 358 set_subject = room_set_subject; |
359 route_stanza = function(room, stanza) end -- Replace with a routing function, e.g., function(room, stanza) core_route_stanza(origin, stanza); end | 359 route_stanza = function(room, stanza) end; -- Replace with a routing function, e.g., function(room, stanza) core_route_stanza(origin, stanza); end |
360 _jid_nick = {}; | 360 _jid_nick = {}; |
361 _participants = {}; | 361 _participants = {}; |
362 _data = {}; | 362 _data = {}; |
363 } | 363 } |
364 end | 364 end |