ObjXMPP  Check-in [800ffa81e3]

Overview
Comment:XMPPPresence: Treat no priority element as a priority of 0
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 800ffa81e38f7020d9504df36b6b1defb75e0fc508c9b8fb92a813d682824bfd
User & Date: florob@babelmonkeys.de on 2013-02-10 22:24:30
Other Links: manifest | tags
Context
2013-02-12
18:43
Add missing files to Xcode project. check-in: 3c7399a750 user: js tags: trunk
2013-02-10
22:24
XMPPPresence: Treat no priority element as a priority of 0 check-in: 800ffa81e3 user: florob@babelmonkeys.de tags: trunk
22:23
XMPPContact: Handle presences without resource check-in: cf986fb621 user: florob@babelmonkeys.de tags: trunk
Changes

Modified src/XMPPPresence.m from [b650ac13b8] to [2470b625ea].

207
208
209
210
211
212
213

214
215
216
217
218
219
220
221
222
223
224
225



226

227




228
229
230
231
232
233
234
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231

232
233
234
235
236
237
238
239
240
241
242







+












+
+
+

+
-
+
+
+
+







{
	return [[priority copy] autorelease];
}

- (of_comparison_result_t)compare: (id <OFComparing>)object
{
	XMPPPresence *otherPresence;
	OFNumber *otherPriority;
	OFString *otherShow;
	of_comparison_result_t priorityOrder;

	if (object == self)
		return OF_ORDERED_SAME;

	if (![object isKindOfClass: [XMPPPresence class]])
		@throw [OFInvalidArgumentException
		    exceptionWithClass: [self class]
			      selector: _cmd];

	otherPresence = (XMPPPresence*)object;
	otherPriority = [otherPresence priority];
	if (otherPriority == nil)
		otherPriority = [OFNumber numberWithInt8: 0];

	if (priority != nil)
	priorityOrder = [priority compare: [otherPresence priority]];
		priorityOrder = [priority compare: otherPriority];
	else
		priorityOrder =
		    [[OFNumber numberWithInt8: 0] compare: otherPriority];

	if (priorityOrder != OF_ORDERED_SAME)
		return priorityOrder;

	otherShow = [otherPresence show];
	if ([show isEqual: otherShow])
		return OF_ORDERED_SAME;