[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.3/kdenetwork/kopete/protocols/jabber
From: Matt Rogers <mattr () kde ! org>
Date: 2009-10-10 3:08:23
Message-ID: 1255144103.775065.24316.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1033390 by mattr:
Fix setting user mood to 'None'
Patch by Romain GUINOT. Thanks!
This is the KDE 4.3 version of the patch.
CCBUG: 111329
M +5 -9 jabberaccount.cpp
M +13 -9 tasks/mood.cpp
--- branches/KDE/4.3/kdenetwork/kopete/protocols/jabber/jabberaccount.cpp \
#1033389:1033390 @@ -1110,15 +1110,11 @@
{
KAction *action = (KAction *)sender();
Mood::Type type = (Mood::Type)action->data().toInt();
- if(type == Mood::None)
- {
- }
- else
- {
- PubSubItem psi("current", \
Mood(type).toXml(*client()->client()->rootTask()->doc()));
- JT_PubSubPublish *task = new JT_PubSubPublish(client()->client()->rootTask(), \
QString("http://jabber.org/protocol/mood"), psi);
- task->go(true);
- }
+
+ PubSubItem psi("current", \
Mood(type).toXml(*client()->client()->rootTask()->doc())); + JT_PubSubPublish \
*task = new JT_PubSubPublish(client()->client()->rootTask(), \
QString("http://jabber.org/protocol/mood"), psi); + task->go(true);
+
}
void JabberAccount::slotSubscription (const XMPP::Jid & jid, const QString & type)
--- branches/KDE/4.3/kdenetwork/kopete/protocols/jabber/tasks/mood.cpp \
#1033389:1033390 @@ -34,15 +34,19 @@
{
QDomElement mood = doc.createElement("mood");
mood.setAttribute("xmlns", MOOD_NS);
- QDomElement e = doc.createElement(MoodManager::self()->getMoodId(mType));
- mood.appendChild(e);
- if(!mText.isEmpty())
- {
- QDomElement text = doc.createElement("text");
- QDomText t = doc.createTextNode(mText);
- text.appendChild(t);
- mood.appendChild(text);
- }
+ QString moodId = MoodManager::self()->getMoodId(mType);
+ if(!moodId.isEmpty())
+ {
+ QDomElement e = doc.createElement(MoodManager::self()->getMoodId(mType));
+ mood.appendChild(e);
+ if(!mText.isEmpty())
+ {
+ QDomElement text = doc.createElement("text");
+ QDomText t = doc.createTextNode(mText);
+ text.appendChild(t);
+ mood.appendChild(text);
+ }
+ }
return mood;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic