Пример #1
0
	void MRIMAccount::DenyAuth (QObject *obj)
	{
		qDebug () << Q_FUNC_INFO << GetAccountName ();
		MRIMBuddy *buddy = qobject_cast<MRIMBuddy*> (obj);
		if (!buddy)
		{
			qWarning () << Q_FUNC_INFO
					<< "wrong object"
					<< obj;
			return;
		}

		emit removedCLItems (QList<QObject*> () << buddy);
		Buddies_.value (buddy->GetHumanReadableID (), buddy)->deleteLater ();
		Buddies_.remove (buddy->GetHumanReadableID ());
	}
Пример #2
0
	void MRIMAccount::Authorize (QObject *obj)
	{
		qDebug () << Q_FUNC_INFO << GetAccountName ();
		MRIMBuddy *buddy = qobject_cast<MRIMBuddy*> (obj);
		if (!buddy)
		{
			qWarning () << Q_FUNC_INFO
					<< "wrong object"
					<< obj;
			return;
		}

		const QString& id = buddy->GetHumanReadableID ();
		Conn_->Authorize (id);

		buddy->SetAuthorized (true);

		if (!Buddies_.contains (id))
			Buddies_ [id] = buddy;
		if (buddy->GetID () < 0)
		{
			const auto seq = Conn_->AddContact (0, id, buddy->GetEntryName ());
			PendingAdditions_ [seq] = buddy->GetInfo ();
		}
	}
Пример #3
0
	void Plugin::entryServiceRequested ()
	{
		const QString& url = sender ()->property ("URL").toString ();
		QObject *buddyObj = sender ()->property ("Azoth/Vader/Entry").value<QObject*> ();
		MRIMBuddy *buddy = qobject_cast<MRIMBuddy*> (buddyObj);
		const QString& subst = VaderUtil::SubstituteNameDomain (url,
				buddy->GetHumanReadableID ());
		const Entity& e = Util::MakeEntity (QUrl (subst),
				QString (),
				static_cast<LeechCraft::TaskParameters> (OnlyHandle | FromUserInitiated));
		emit gotEntity (e);
	}
Пример #4
0
	void MRIMAccount::RemoveEntry (QObject *obj)
	{
		MRIMBuddy *buddy = qobject_cast<MRIMBuddy*> (obj);
		if (!buddy)
		{
			qWarning () << Q_FUNC_INFO
					<< "wrong object"
					<< obj;
			return;
		}

		const qint64 id = buddy->GetID ();
		if (id < 0)
		{
			qWarning () << Q_FUNC_INFO
					<< "cannot remove buddy with negative ID";
			return;
		}

		Buddies_.take (buddy->GetHumanReadableID ())->deleteLater ();
		emit removedCLItems (QList<QObject*> () << buddy);

		Conn_->RemoveContact (id, buddy->GetHumanReadableID (), buddy->GetEntryName ());
	}