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

@ -172,14 +172,14 @@ void NowListeningPlugin::slotMediaCommand( const TQString &args, Kopete::ChatSes
// prevent us sending an empty message
advert = i18n("Message from Kopete user to another user; used when sending media information even though there are no songs playing or no media players running", "Now Listening for Kopete - it would tell you what I am listening to, if I was listening to something on a supported media player.");
}
Kopete::Message msg( theChat->myself(),
theChat->members(),
advert + " " + args,
Kopete::Message::Outbound,
Kopete::Message::RichText
Kopete::Message::PlainText
);
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 &)));
new JT_ServInfo(rootTask());
new PongServer(rootTask());
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;
}

@ -263,7 +263,7 @@ namespace XMPP
const Jid & jid() const;
const VCard & vcard() const;
void onGo();
bool take(const TQDomElement &x);
@ -405,15 +405,15 @@ namespace XMPP
public:
JT_DiscoItems(Task *);
~JT_DiscoItems();
void get(const Jid &, const TQString &node = TQString());
void get(const DiscoItem &);
const DiscoList &items() const;
void onGo();
bool take(const TQDomElement &);
private:
class Private;
Private *d;
@ -426,17 +426,17 @@ namespace XMPP
public:
JT_DiscoInfo(Task *);
~JT_DiscoInfo();
void get(const Jid &, const TQString &node = TQString(), const DiscoItem::Identity = DiscoItem::Identity());
void get(const DiscoItem &);
const DiscoItem &item() const;
const Jid& jid() const;
const TQString& node() const;
void onGo();
bool take(const TQDomElement &);
private:
class Private;
Private *d;
@ -445,16 +445,16 @@ namespace XMPP
class JT_DiscoPublish : public Task
{
Q_OBJECT
TQ_OBJECT
TQ_OBJECT
public:
JT_DiscoPublish(Task *);
~JT_DiscoPublish();
void set(const Jid &, const DiscoList &);
void onGo();
bool take(const TQDomElement &);
private:
class Private;
Private *d;
@ -463,7 +463,7 @@ namespace XMPP
class JT_MucPresence : public Task
{
Q_OBJECT
TQ_OBJECT
TQ_OBJECT
public:
JT_MucPresence(Task *parent);
~JT_MucPresence();
@ -480,28 +480,40 @@ namespace XMPP
class Private;
Private *d;
};
class JT_PrivateStorage : public Task
{
Q_OBJECT
TQ_OBJECT
TQ_OBJECT
public:
JT_PrivateStorage(Task *parent);
~JT_PrivateStorage();
void set(const TQDomElement &);
void get(const TQString &tag, const TQString& xmlns);
TQDomElement element();
void onGo();
bool take(const TQDomElement &);
private:
class Private;
Private *d;
};
class PongServer : public Task
{
Q_OBJECT
TQ_OBJECT
public:
PongServer(Task *);
~PongServer();
bool take(const TQDomElement &);
};
}
#endif

Loading…
Cancel
Save