Пример #1
0
QDebug operator<<(QDebug dbg, const qutim_sdk_0_3::Message &msg)
{
	dbg.nospace() << QLatin1String("Ureen::Message(")
				  << QLatin1String("id: ") << msg.id()
				  << QLatin1String("chatUnit: ") << msg.chatUnit()
				  << QLatin1String("isIncoming: ") << msg.isIncoming()
				  << QLatin1String("text: ") << msg.text()
				  << QLatin1String("time: ") << msg.time()
				  << QLatin1String("properties: (");
	foreach (QByteArray name, msg.dynamicPropertyNames())
		dbg.nospace() << name << ": " << msg.property(name);
	return dbg.nospace() << QLatin1String(") )");
}
Пример #2
0
void NetworkManager::sendMessage(const qutim_sdk_0_3::Message &message)
{
	MessageAction *action = new MessageAction();
	ChatUnit *contact = const_cast<ChatUnit*>(message.chatUnit()->getHistoryUnit());
	action->account = AccountId(contact->account());
	action->contact = contact->id();
	action->time = message.time();
	action->text = message.text();
	action->incoming = message.isIncoming();
	if (message.property("otrEncrypted", false))
		action->encryption << QLatin1String("otr");
	if (message.property("pgpEncrypted", false)
	        || (encryptedMessageIdInited
	            && encryptedMessageId == message.id())) {
		action->encryption << QLatin1String("pgp");
	}
    if (message.property("autoreply", false))
        action->encryption << QLatin1String("autoreply");
	m_actions << action;
	trySend();
}