272 origin.send(st.error_reply(stanza, "cancel", "conflict")); |
272 origin.send(st.error_reply(stanza, "cancel", "conflict")); |
273 else |
273 else |
274 log("debug", "%s joining as %s", from, to); |
274 log("debug", "%s joining as %s", from, to); |
275 local data; |
275 local data; |
276 if not rooms:get(room) and not rooms_info:get(room) then -- new room |
276 if not rooms:get(room) and not rooms_info:get(room) then -- new room |
|
277 rooms_info:set(room, 'name', (jid_split(room))); |
277 data = {affiliation='owner', role='moderator', jid=from, sessions={[from]=get_filtered_presence(stanza)}}; |
278 data = {affiliation='owner', role='moderator', jid=from, sessions={[from]=get_filtered_presence(stanza)}}; |
278 end |
279 end |
279 if not data then -- new occupant |
280 if not data then -- new occupant |
280 data = {affiliation='none', role='participant', jid=from, sessions={[from]=get_filtered_presence(stanza)}}; |
281 data = {affiliation='none', role='participant', jid=from, sessions={[from]=get_filtered_presence(stanza)}}; |
281 end |
282 end |