Skip to content

Commit 7f985a0

Browse files
lissine0tmolitor-stud-tu
authored andcommitted
Make gateway detection more reliable when generating a room address
Before this commit, monal checked that an entity is not a gateway by verifying that its identity's type is 'text' https://xmpp.org/registrar/disco-categories.html#conference But non-IRC gateways can have an identity type of 'text'. Now, it will be checking that the entity does not advertise a category of 'gateway', as that's more robust. https://xmpp.org/extensions/xep-0100.html#example-3 This should work with Biboumi and Slidge.
1 parent 418c3b9 commit 7f985a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Monal/Classes/MLMucProcessor.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,10 @@ -(NSString* _Nullable) generateMucJid
979979
NSString* mucServer = nil;
980980
for(NSString* jid in _account.connectionProperties.conferenceServers)
981981
{
982-
if([_account.connectionProperties.conferenceServers[jid] check:@"identity<type=text>"])
982+
// Do not use gateways
983+
if(![_account.connectionProperties.conferenceServers[jid] check:@"identity<category=gateway>"]
984+
&& [_account.connectionProperties.conferenceServers[jid] check:@"identity<category=conference>"]
985+
&& [_account.connectionProperties.conferenceServers[jid] check:@"identity<type=text>"])
983986
{
984987
mucServer = jid;
985988
break;

0 commit comments

Comments
 (0)