Bug 111329 - Jabbe : JEP-0107: User Mood
Summary: Jabbe : JEP-0107: User Mood
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Unmaintained
Component: Jabber Plugin (other bugs)
Version First Reported In: unspecified
Platform: Mandriva RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-23 01:31 UTC by Nicolas L.
Modified: 2009-10-10 22:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
proposed patch to be able to reset a jabber mood back to none (1.88 KB, patch)
2009-10-04 17:27 UTC, Romain GUINOT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas L. 2005-08-23 01:31:53 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    Mandriva RPMs

could we have the support for the JEP 107 ?

see here :

http://www.jabber.org/jeps/jep-0107.html
Comment 1 Nicolas L. 2007-07-13 13:53:44 UTC
can someone take a look at this ?    ( psi have it now )
Comment 2 Tomas Racek 2009-01-30 17:26:54 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Romain GUINOT 2009-10-01 11:18:05 UTC
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,
Comment 4 Romain GUINOT 2009-10-04 17:27:55 UTC
Created attachment 37357 [details]
proposed patch to be able to reset a jabber mood back to none
Comment 5 Matt Rogers 2009-10-10 05:08:26 UTC
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  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1033390
Comment 6 Matt Rogers 2009-10-10 22:00:43 UTC
SVN commit 1033693 by mattr:

Fix setting user mood to 'None'

Patch by Romain GUINOT. Thanks!
This is the KDE 4.4 version of the patch. It will also be fixed for KDE
4.3.3
BUG: 111329

 M  +5 -9      jabberaccount.cpp  
 M  +13 -9     tasks/mood.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1033693