|
@@ -157,6 +157,17 @@ Strophe.addConnectionPlugin('emuc', {
|
157
|
157
|
var from = pres.getAttribute('from');
|
158
|
158
|
if ($(pres).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
|
159
|
159
|
$(document).trigger('passwordrequired.muc', [from]);
|
|
160
|
+ } else if ($(pres).find(
|
|
161
|
+ '>error[type="cancel"]>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
|
|
162
|
+ var toDomain = Strophe.getDomainFromJid(pres.getAttribute('to'));
|
|
163
|
+ if(toDomain === config.hosts.anonymousdomain) {
|
|
164
|
+ // we are connected with anonymous domain and only non anonymous users can create rooms
|
|
165
|
+ // we must authorize the user
|
|
166
|
+ $(document).trigger('passwordrequired.main');
|
|
167
|
+ }
|
|
168
|
+ else
|
|
169
|
+ console.warn('onPresError ', pres);
|
|
170
|
+
|
160
|
171
|
} else {
|
161
|
172
|
console.warn('onPresError ', pres);
|
162
|
173
|
}
|