[telepathy] [Bug 325433] Status: sorting and submenus

Fuchs develop at fuchsnet.ch
Wed Nov 6 22:53:28 GMT 2013


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

--- Comment #1 from Fuchs <develop at fuchsnet.ch> ---
As I just patched this for my personal use I noticed that there already is a
function which does exactly this: sort per presence. 

http://api.kde.org/extragear-api/network-apidocs/telepathy/ktp-common-internals/html/presence_8cpp_source.html#l00111

As per the documentation, this "Returns an int representation of the presence
type sorted by priority. 0 - most online, 7 - offline"

Looking at this list either I do not get the logic behind it or I clearly
disagree, as neither "busy" nor "hidden" should be more online than away. Is
this used anywere in KTp that depends on the order being exactly like that?
Else I'd recommend changing the order there to 

    switch(type) {
        case Tp::ConnectionPresenceTypeAvailable:
            return 0;
        case Tp::ConnectionPresenceTypeAway:
            return 1;
        case Tp::ConnectionPresenceTypeExtendedAway:
            return 2;
        case Tp::ConnectionPresenceTypeBusy: 
            return 3;
       case Tp::ConnectionPresenceTypeHidden:
            return 4;
        //don't distinguish between the following three presences
        case Tp::ConnectionPresenceTypeError:
        case Tp::ConnectionPresenceTypeUnknown:
        case Tp::ConnectionPresenceTypeUnset:
            return 5;
        case Tp::ConnectionPresenceTypeOffline:
        default:
            return 6;

Which fixes this bug all over ktp. 

Thanks in advance, kind regards

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Kde-telepathy-bugs mailing list