From c4cb664b78c29ba121d74943c6e670df9a2f1572 Mon Sep 17 00:00:00 2001 From: Summon Yang Date: Mon, 24 Aug 2015 14:48:45 +0800 Subject: [PATCH 1/2] Groupchat should not deal with chat message. --- Extensions/XEP-0045/XMPPRoom.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Extensions/XEP-0045/XMPPRoom.m b/Extensions/XEP-0045/XMPPRoom.m index 22379f3b57..6e77606584 100644 --- a/Extensions/XEP-0045/XMPPRoom.m +++ b/Extensions/XEP-0045/XMPPRoom.m @@ -1053,7 +1053,11 @@ - (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)prese - (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message { - // This method is invoked on the moduleQueue. + if ([[message type] isEqualToString:@"chat"]) { // Room should not deal with single chat message + return NO; + } + + // This method is invoked on the moduleQueue. XMPPJID *from = [message from]; @@ -1093,6 +1097,10 @@ - (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message - (void)xmppStream:(XMPPStream *)sender didSendMessage:(XMPPMessage *)message { + if ([[message type] isEqualToString:@"chat"]) { // Room should not deal with single chat message + return NO; + } + // This method is invoked on the moduleQueue. XMPPJID *to = [message to]; From e5248e113255f515f64ccd1550447b090584d87e Mon Sep 17 00:00:00 2001 From: Summon Yang Date: Mon, 24 Aug 2015 14:49:53 +0800 Subject: [PATCH 2/2] Chat should not deal with groupchat message. --- Extensions/XEP-0136/XMPPMessageArchiving.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Extensions/XEP-0136/XMPPMessageArchiving.m b/Extensions/XEP-0136/XMPPMessageArchiving.m index 57e8ce08e3..83482289d4 100644 --- a/Extensions/XEP-0136/XMPPMessageArchiving.m +++ b/Extensions/XEP-0136/XMPPMessageArchiving.m @@ -193,7 +193,11 @@ - (BOOL)shouldArchiveMessage:(XMPPMessage *)message outgoing:(BOOL)isOutgoing xm // // 2. 'otr' and 'expire' value are taken from the element that matches the contact, if present, // else from the default element. - + + if ([[message type] isEqualToString:@"groupchat"]) { // chat should not deal with groupchat message + return NO; + } + NSXMLElement *match = nil; NSString *messageThread = [[message elementForName:@"thread"] stringValue];