QByteArray RoomCLEntry::GetAffName (QObject *participant) const { RoomParticipantEntry *entry = qobject_cast<RoomParticipantEntry*> (participant); if (!entry) { qWarning () << Q_FUNC_INFO << participant << "is not a RoomParticipantEntry"; return "noaffiliation"; } return Aff2Str_ [entry->GetAffiliation ()]; }
IMUCEntry::MUCAffiliation RoomCLEntry::GetAffiliation (QObject *participant) const { if (!participant) participant = RH_->GetSelf (); RoomParticipantEntry *entry = qobject_cast<RoomParticipantEntry*> (participant); if (!entry) { qWarning () << Q_FUNC_INFO << participant << "is not a RoomParticipantEntry"; return MUCAInvalid; } return static_cast<MUCAffiliation> (entry->GetAffiliation ()); }
QMap<QByteArray, QList<QByteArray>> RoomCLEntry::GetPerms (QObject *participant) const { if (!participant) participant = RH_->GetSelf (); QMap<QByteArray, QList<QByteArray>> result; RoomParticipantEntry *entry = qobject_cast<RoomParticipantEntry*> (participant); if (!entry) { qWarning () << Q_FUNC_INFO << participant << "is not a RoomParticipantEntry"; result ["role"] << "norole"; result ["aff"] << "noaffiliation"; } else { result ["role"] << Role2Str_.value (entry->GetRole (), "invalid"); result ["aff"] << Aff2Str_.value (entry->GetAffiliation (), "invalid"); } return result; }