XMPPFramework
XMPPFramework copied to clipboard
XMPPRoom's delegate method xmppRoomDidDestroy can't be called
Hi, all. When I call XMPPRoom's destroyRoom method, the delegate method
-(void)xmppRoomDidDestroy:(XMPPRoom*)sender can't be called. After I digging into the source code of XMPPRoom class and XEP-0045 specification, I found the problem: in the process of destroying a chat room, service broadcast self unavailable presence to each occupant, and in the XMPPRoom's implementation:
- (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence
{
// ...
if (isMyPresence)
{
if (isAvailable)
{
// ...
}
else if (isUnavailable && !isNicknameChange)
{
state = kXMPPRoomStateNone;
[responseTracker removeAllIDs]; // response of destroying room IQ comes after
// presence broadcast, but tracker is removed
[xmppRoomStorage handleDidLeaveRoom:self];
[multicastDelegate xmppRoomDidLeave:self];
}
}
else
{
// ...
}
}
What's the solution? Add a state kXMPPRoomStateDestroying, and check it whether we should remove all response trackers, is it ok?
same question,did you solved it?