Closed lucazulian closed 7 years ago
Oh interesting. Do you know the server software?
On Sun, Jun 5, 2016 at 10:02 AM, Luca Zulian notifications@github.com wrote:
When I create multiple MUC, the first two mucs work correctly, but "sometimes" it duplicates the room. It seems that the client shows the MUC as a private chat and then, when I type something, it shows the MUC chat.
[image: untitled] https://cloud.githubusercontent.com/assets/3492584/15806931/a2c77e32-2b4f-11e6-8032-e978601d7633.png
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ChatSecure/ChatSecure-iOS/issues/507, or mute the thread https://github.com/notifications/unsubscribe/AAfqH9NRgYwtA9bpub9HFaGX8ys5wrHiks5qIwE2gaJpZM4IuZZk .
Ejabberd 16.03...if you want I can give you the docker compose file. But I think that the problem could be the carbon copy module. I tried the muc with ChatSecure (dev branch) and Adium, and the problem happens when Adium client send message to the muc. In Xcode log I see this:
OTRXMPPManager: xmppStream:didReceiveMessage: <message xmlns="jabber:client" from="542a9927-7a29-4dc1-a75f-e093ed7ce18b@conference.prj.io" to="luca@prj.io/chatsecure87379" type="error"><active xmlns="http://jabber.org/protocol/chatstates"/><error code="406" type="modify"><not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">It is not allowed to send private messages to the conference</text></error></message>
I suspect ChatSecure is not able to handle correctly this case, as it shows one muc and one private chat
I can't provide screenshots nor logs but I can confirm that happens with Prosody too. Two conferences are created when someone invites you. One with the subject and another with the MUC address. The conference that works is the one showing the subject. The other MUC, is just like a mirror of the working MUC without people, and messages the user write inside that MUC are not sent.
same here, i modified the OTRXMPPManager so that no history is requested :
[historyElement addAttributeWithName:@"since" stringValue:dateTimeString]
[historyElement addAttributeWithName:@"maxstanzas" stringValue:@"0"];
and then also fully removing it, none works
Seems to me that the databaseRoomKey is computed differently and thus creates a new room on
Any ideas here?
seems to be an issue here?
/**
Stores or otherwise handles the given message element. **/
NSLog(@"myRoomJid: %@ messageJid: %@",myRoomJID.bare,messageJID.bare); if ([myRoomJID isEqualToJID:messageJID]) { if (![message wasDelayed]) { // Ignore - we already stored message in handleOutgoingMessage:room: return; } }
[self.databaseConnection asyncReadWithBlock:^(YapDatabaseReadTransaction * _Nonnull transaction) { [transaction objectForKey:messageJID.bare inCollection:[OTRXMPPRoom collection]]; }];
//May need to check if the message is unique. Unsure if this is a real problem. Look at XMPPRoomCoreDataStorage.m existsMessage: [self insertIncomingMessage:message intoRoom:room]; }
focus on handleIncomingMessage: // Ignore - we already stored message in handleOutgoingMessage:room:
but then:
is empty?
FYI: I found the issue to be in OTRXMPPMessageYapStorage handleMessage:stream:incoming
temporarily, i added:
if([fromStr containsString:@"conference"] || [toStr containsString:@"conference"]) {
if([xmppMessage isGroupChatMessageWithSubject] == NO) {
return;
}
}
just above: if([[activeThread threadIdentifier] isEqualToString:message.threadId]) { message.read = YES; }
and problem goes away
This is against an openfire 4.0.1 server
@chrisballinger @lucazulian @theSouL @davidchiles
update: the issue real is in:
OTREncruptionManager's
[[OTRDatabaseManager sharedInstance].readWriteDatabaseConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[originalMessage saveWithTransaction:transaction];
//Update lastMessageDate for sorting and grouping
**OTRBuddy *buddy = [OTRBuddy fetchObjectWithUniqueID:originalMessage.buddyUniqueId transaction:transaction];
buddy.lastMessageDate = originalMessage.date;
[buddy saveWithTransaction:transaction];**
// Send delivery receipt
OTRAccount *account = [OTRAccount fetchObjectWithUniqueID:buddy.accountUniqueId transaction:transaction];
OTRXMPPManager *protocol = (OTRXMPPManager*) [[OTRProtocolManager sharedInstance] protocolForAccount:account];
[protocol sendDeliveryReceiptForMessage:originalMessage];
} completionBlock:^{
[[UIApplication sharedApplication] showLocalNotification:originalMessage];
}];
}
if will ALWAYS create a buddy, dont know why decodedMessage is being called for groups, but it goes there.
this fixes it for me (temp fix): [[OTRDatabaseManager sharedInstance].readWriteDatabaseConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { [originalMessage saveWithTransaction:transaction];
OTRBuddy *localbuddy = [OTRBuddy fetchObjectWithUniqueID:originalMessage.buddyUniqueId transaction:transaction];
NSString *username = localbuddy.username;
NSString *accountId;
if ([username containsString:@"@conference"]) {
OTRXMPPRoom *room = [OTRXMPPRoom fetchObjectWithUniqueID:originalMessage.buddyUniqueId transaction:transaction];
room.lastRoomMessageDate = originalMessage.date;
[room saveWithTransaction:transaction];
accountId = room.accountUniqueId;
} else {
//Update lastMessageDate for sorting and grouping
OTRBuddy *buddy = [OTRBuddy fetchObjectWithUniqueID:originalMessage.buddyUniqueId transaction:transaction];
buddy.lastMessageDate = originalMessage.date;
[buddy saveWithTransaction:transaction];
accountId = buddy.accountUniqueId;
}
Looking into this again now, thanks for the research!
I think this is fixed in b909943e6f5f9c4b34bb14533b9a5d256e4a8e71
When I create multiple MUC, the first two mucs work correctly, but "sometimes" it duplicates the room. It seems that the client shows the MUC as a private chat and then, when I type something, it shows the MUC chat.