Commit two patches to kdenetwork from Slávek Banko:

1.) fix problem with html special chars (especially &) in messages from nowlistening plugin in kopete. Kopete::Message::RichText expects already escaped chars, but messages from nowlistening is plain text. With Kopete::Message::PlainText is message valid
2.) add pongserver, that add xep-0199 responses to kopete


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1251584 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 39f99c18f8
commit 6f832f8441

@ -177,7 +177,7 @@ void NowListeningPlugin::slotMediaCommand( const TQString &args, Kopete::ChatSes
theChat->members(), theChat->members(),
advert + " " + args, advert + " " + args,
Kopete::Message::Outbound, Kopete::Message::Outbound,
Kopete::Message::RichText Kopete::Message::PlainText
); );
theChat->sendMessage( msg ); theChat->sendMessage( msg );

@ -223,6 +223,7 @@ void Client::start(const TQString &host, const TQString &user, const TQString &p
connect(pr, TQT_SIGNAL(roster(const Roster &)), TQT_SLOT(prRoster(const Roster &))); connect(pr, TQT_SIGNAL(roster(const Roster &)), TQT_SLOT(prRoster(const Roster &)));
new JT_ServInfo(rootTask()); new JT_ServInfo(rootTask());
new PongServer(rootTask());
d->active = true; d->active = true;
} }
@ -1520,3 +1521,35 @@ LiveRoster::ConstIterator LiveRoster::find(const Jid &j, bool compareRes) const
} }
} }
//----------------------------------------------------------------------------
// PongServer
//----------------------------------------------------------------------------
/**
* \class PongServer
* \brief Answers XMPP Pings
*/
PongServer::PongServer(Task *parent)
:Task(parent)
{
}
PongServer::~PongServer()
{
}
bool PongServer::take(const TQDomElement &e)
{
if (e.tagName() != "iq" || e.attribute("type") != "get")
return false;
bool found = false;
TQDomElement ping = findSubTag(e, "ping", &found);
if (found && ping.attribute("xmlns") == "urn:xmpp:ping") {
TQDomElement iq = createIQ(doc(), "result", e.attribute("from"), e.attribute("id"));
send(iq);
return true;
}
return false;
}

@ -502,6 +502,18 @@ namespace XMPP
Private *d; Private *d;
}; };
class PongServer : public Task
{
Q_OBJECT
TQ_OBJECT
public:
PongServer(Task *);
~PongServer();
bool take(const TQDomElement &);
};
} }
#endif #endif

Loading…
Cancel
Save