Exemple #1
0
	IMUCEntry::MUCRole RoomCLEntry::GetRole (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 MUCRInvalid;
		}

		return static_cast<MUCRole> (entry->GetRole ());
	}
Exemple #2
0
	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;
	}