XMPPPresence: Treat no priority element as a priority of 0
This commit is contained in:
parent
dc9d18f536
commit
b96b4bb86d
1 changed files with 9 additions and 1 deletions
|
@ -211,6 +211,7 @@ static int show_to_int(OFString *show)
|
||||||
- (of_comparison_result_t)compare: (id <OFComparing>)object
|
- (of_comparison_result_t)compare: (id <OFComparing>)object
|
||||||
{
|
{
|
||||||
XMPPPresence *otherPresence;
|
XMPPPresence *otherPresence;
|
||||||
|
OFNumber *otherPriority;
|
||||||
OFString *otherShow;
|
OFString *otherShow;
|
||||||
of_comparison_result_t priorityOrder;
|
of_comparison_result_t priorityOrder;
|
||||||
|
|
||||||
|
@ -223,8 +224,15 @@ static int show_to_int(OFString *show)
|
||||||
selector: _cmd];
|
selector: _cmd];
|
||||||
|
|
||||||
otherPresence = (XMPPPresence*)object;
|
otherPresence = (XMPPPresence*)object;
|
||||||
|
otherPriority = [otherPresence priority];
|
||||||
|
if (otherPriority == nil)
|
||||||
|
otherPriority = [OFNumber numberWithInt8: 0];
|
||||||
|
|
||||||
priorityOrder = [priority compare: [otherPresence priority]];
|
if (priority != nil)
|
||||||
|
priorityOrder = [priority compare: otherPriority];
|
||||||
|
else
|
||||||
|
priorityOrder =
|
||||||
|
[[OFNumber numberWithInt8: 0] compare: otherPriority];
|
||||||
|
|
||||||
if (priorityOrder != OF_ORDERED_SAME)
|
if (priorityOrder != OF_ORDERED_SAME)
|
||||||
return priorityOrder;
|
return priorityOrder;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue