Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MUC ROOM Destroy #132

Open
jonasman opened this issue Jan 7, 2013 · 0 comments
Open

MUC ROOM Destroy #132

jonasman opened this issue Jan 7, 2013 · 0 comments

Comments

@jonasman
Copy link

jonasman commented Jan 7, 2013

When a room is destroyed it is not very well handled.

in
- (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence

I added:

 BOOL isDestroy     = [x elementForName:@"destroy"] != nil;

And then i added:

if (isAvailable)
    {
        if (state & kXMPPRoomStateJoining)
        {
            state &= ~kXMPPRoomStateJoining;
            state |=  kXMPPRoomStateJoined;

            if ([xmppRoomStorage respondsToSelector:@selector(handleDidJoinRoom:withNickname:)])
                [xmppRoomStorage handleDidJoinRoom:self withNickname:myNickname];
            [multicastDelegate xmppRoomDidJoin:self];
        }
    }
    else if (isDestroy)
    {
        state = kXMPPRoomStateNone;
        [responseTracker removeAllIDs];

        [xmppRoomStorage handleDidLeaveRoom:self];
        [multicastDelegate xmppRoomDidDestroy:self];
    }
    else if (isUnavailable && !isNicknameChange)
    {
        state = kXMPPRoomStateNone;
        [responseTracker removeAllIDs];

        [xmppRoomStorage handleDidLeaveRoom:self];
        [multicastDelegate xmppRoomDidLeave:self];
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant