[kopete-bugs] [Bug 111329] Jabbe : JEP-0107: User Mood

Romain GUINOT romainguinot at gmail.com
Thu Oct 1 11:18:11 CEST 2009


https://bugs.kde.org/show_bug.cgi?id=111329


Romain GUINOT <romainguinot at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mattr at kde.org,
                   |                            |romainguinot at gmail.com




--- Comment #3 from Romain GUINOT <romainguinot gmail com>  2009-10-01 11:18:05 ---
resetting a user mood back to none does not work right now. 
Currently, in protocols/jabber/jabberaccount.cpp (1109-1122)  nothing is done
when the mood is 'None'. According to the spec
(http://xmpp.org/extensions/xep-0107.html#proto-pubsub), an empty mood tag with
no payload should be sent. 

Code snippet : 

void JabberAccount::slotSetMood()
{
    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);
    }
}


I think this if check should be removed and the pubsub should be sent even if
the type is 'None'. 

It looks like the toXml method in mood.cpp would need to be changed to not
create a sub-QDomElement when mood id points to None and just return and
self-closing <mood xmlns='http://jabber.org/protocol/mood'/> tag. 

I currently do not have the time to set up a build environment and test
this,but it should be an easy fix for someone who knows the API and has a build
env up and running. 

I'll try it myself in the next few days probably. 

Regards,

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the kopete-bugs mailing list