Ejemplo n.º 1
0
	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 ()];
	}
Ejemplo n.º 2
0
	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 ());
	}
Ejemplo n.º 3
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;
	}