113 send("</stream:features>"); |
113 send("</stream:features>"); |
114 log("info", "Stream opened successfully"); |
114 log("info", "Stream opened successfully"); |
115 session.notopen = nil; |
115 session.notopen = nil; |
116 end |
116 end |
117 |
117 |
|
118 function send_to_available_resources(user, host, stanza) |
|
119 local to = stanza.attr.to; |
|
120 stanza.attr.to = nil; |
|
121 local h = hosts[host]; |
|
122 if h and h.type == "local" then |
|
123 local u = h.sessions[user]; |
|
124 if u then |
|
125 for k, session in pairs(u.sessions) do |
|
126 if session.presence then |
|
127 session.send(stanza); |
|
128 end |
|
129 end |
|
130 end |
|
131 end |
|
132 stanza.attr.to = to; |
|
133 end |
|
134 |
118 return _M; |
135 return _M; |