diff --git a/Monal/Classes/MLMessageProcessor.m b/Monal/Classes/MLMessageProcessor.m index f93fbfde8..1dff23a1b 100644 --- a/Monal/Classes/MLMessageProcessor.m +++ b/Monal/Classes/MLMessageProcessor.m @@ -397,13 +397,6 @@ +(MLMessage* _Nullable) processMessage:(XMPPMessage*) messageNode andOuterMessag return nil; } - //ignore all other groupchat messages coming from bare jid (e.g. not being a "normal" muc message nor a subject update handled above) - if([messageNode check:@"/"] && !messageNode.fromResource) - { - DDLogVerbose(@"Ignoring groupchat message without resource (should be already handled above)..."); - return nil; - } - NSString* decrypted; if([messageNode check:@"{eu.siacs.conversations.axolotl}encrypted/header"]) { @@ -581,6 +574,9 @@ +(MLMessage* _Nullable) processMessage:(XMPPMessage*) messageNode andOuterMessag else if([lowercaseBody hasPrefix:@"https://"]) messageType = kMessageTypeUrl; } + //messages from room jids are classified as status messages + if([messageNode check:@"/"] && !messageNode.fromResource) + messageType = kMessageTypeStatus; DDLogInfo(@"Got message of type: %@", messageType); if(body) diff --git a/Monal/Classes/xmpp.m b/Monal/Classes/xmpp.m index 9fbd0600f..9efc854a7 100644 --- a/Monal/Classes/xmpp.m +++ b/Monal/Classes/xmpp.m @@ -4477,9 +4477,16 @@ -(AnyPromise*) checkJidType:(NSString*) jid [discoInfo setiqTo:jid]; [discoInfo setDiscoInfoNode]; [self sendIq:discoInfo withResponseHandler:^(XMPPIQ* response) { + NSSet* identities = [NSSet setWithArray:[response find:@"{http://jabber.org/protocol/disco#info}query/identity@category"]]; NSSet* features = [NSSet setWithArray:[response find:@"{http://jabber.org/protocol/disco#info}query/feature@var"]]; - //check if this is a muc or account - if([features containsObject:@"http://jabber.org/protocol/muc"]) + //check if this is an account or a muc + //this test has to come first because a gateway component may have an "account" identity while also supporintg MUC. + //usually this means that there's a bot at the component's address that facilitates registration without adhoc commands. + //the "account" jidType makes it possible to add the component as a contact. + if([identities containsObject:@"account"]) + return resolve(@"account"); + else if([identities containsObject:@"conference"] + && [features containsObject:@"http://jabber.org/protocol/muc"]) return resolve(@"muc"); else return resolve(@"account");