void MucExtension::HandleRoomJoined()
{
    QXmppMucRoom *room = qobject_cast<QXmppMucRoom*>(sender());
    if(!room)
        return;

    bool check = connect(room, SIGNAL(messageReceived(QXmppMessage)), this, SLOT(HandleMessageReceived(QXmppMessage)));
    Q_ASSERT(check);

    check = connect(room, SIGNAL(participantAdded(QString)), this, SLOT(HandleParticipantJoined(QString)));
    Q_ASSERT(check);

    check = connect(room, SIGNAL(participantRemoved(QString)), this, SLOT(HandleParticipantLeft(QString)));
    Q_ASSERT(check);

    check = connect(room, SIGNAL(kicked(QString,QString)), this, SIGNAL(RoomRemoved(QString,QString)));
    Q_ASSERT(check);

    rooms_.append(room);
    emit RoomAdded(room->jid(), room->nickName());
}
Exemple #2
0
void ChatExtension::Initialize(Client *client)
{
    client_ = client;

    bool check;
    check = connect(client_->GetQxmppClient(), SIGNAL(messageReceived(QXmppMessage)), this, SLOT(HandleMessageReceived(QXmppMessage)));
    Q_ASSERT(check);
}