Accepting chatroom invitation

后端 未结 2 1292
死守一世寂寞
死守一世寂寞 2020-12-13 22:40

I\'m able to create a MUC using XMPPFramework and send user invitation requests to join that room by using the code below.

// Creating
AppDelegate *dele =(Ap         


        
2条回答
  •  孤街浪徒
    2020-12-13 23:03

    For room invitations and declines, implement XMPPMUCDelegate and its methods -xmppMUC:didReceiveRoomInvitation: and -xmppMUC:didReceiveRoomInvitationDecline:.

    To get the room JID, invoke [message from];

    To join the room, instantiate an XMPPRoom and invoke -joinRoomUsingNickname:history:.

    Then have your room delegate class implement XMPPRoomDelegate, and implement some of the delegate methods to handle receiving messages in the room.

    It looks like there isn't at present a more automatic way to respond to invitations.

    Update: The delegate callbacks now receive the room JID as a parameter, clarifying the semantics a bit.

    - (void)xmppMUC:(XMPPMUC *)sender roomJID:(XMPPJID *) roomJID didReceiveInvitation:(XMPPMessage *)message;
    - (void)xmppMUC:(XMPPMUC *)sender roomJID:(XMPPJID *) roomJID didReceiveInvitationDecline:(XMPPMessage *)message;
    

提交回复
热议问题