ObjXMPP  Check-in [46102a816a]

Overview
Comment:XMPPContactManager: Indentation fixes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 46102a816af7366b4bbca9242d8914f0415276f43b26e97d58a6fac4f112f476
User & Date: florob@babelmonkeys.de on 2013-06-09 10:54:21
Other Links: manifest | tags
Context
2013-06-09
18:21
XMPPContactManager: Remove contact from store after broadcasting the selector check-in: b649d4350d user: florob@babelmonkeys.de tags: trunk
10:54
XMPPContactManager: Indentation fixes check-in: 46102a816a user: florob@babelmonkeys.de tags: trunk
2013-06-05
19:01
XMPPDiscoEntity: Update JID on resource bind check-in: b0b4a4460a user: florob@babelmonkeys.de tags: trunk
Changes

Modified src/XMPPContactManager.m from [42334ca45b] to [77eaa185c9].

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

	contact = [_contacts objectForKey: bareJID];

	if ([[rosterItem subscription] isEqual: @"remove"]) {
		[_contacts removeObjectForKey: bareJID];
		if (contact != nil)
			[_delegates broadcastSelector: @selector(contactManager:
							  didRemoveContact:)
					  withObject: self
					  withObject: contact];
		return;
	}

	if (contact == nil) {
		contact = [[XMPPContact new] autorelease];
		[contact XMPP_setRosterItem: rosterItem];
		[_contacts setObject: contact
			     forKey: bareJID];
		[_delegates broadcastSelector: @selector(contactManager:
						  didAddContact:)
				  withObject: self
				  withObject: contact];
	} else {
		[_delegates broadcastSelector: @selector(contact:
						  willUpdateWithRosterItem:)
				  withObject: contact
				  withObject: rosterItem];
		[contact XMPP_setRosterItem: rosterItem];
	}
}

-   (void)connection: (XMPPConnection*)connection
  didReceivePresence: (XMPPPresence*)presence
{
	XMPPJID *JID = [presence from];
	XMPPContact *contact = [_contacts objectForKey: [JID bareJID]];

	if (contact == nil)
		return;

	// We only care for available and unavailable here, not subscriptions
	if ([[presence type] isEqual: @"available"]) {
		[contact XMPP_setPresence: presence
				 resource: [JID resource]];
		[_delegates broadcastSelector: @selector(contact:
						  didSendPresence:)
				  withObject: contact
				  withObject: presence];
	} else if ([[presence type] isEqual: @"unavailable"]) {
		[contact XMPP_removePresenceForResource: [JID resource]];
		[_delegates broadcastSelector: @selector(contact:
						    didSendPresence:)
				   withObject: contact
				   withObject: presence];
	}
}

-  (void)connection: (XMPPConnection*)connection
  didReceiveMessage: (XMPPMessage*)message







|
|
|









|
|
|


|
|
|


















|
|
|



|







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

	contact = [_contacts objectForKey: bareJID];

	if ([[rosterItem subscription] isEqual: @"remove"]) {
		[_contacts removeObjectForKey: bareJID];
		if (contact != nil)
			[_delegates broadcastSelector: @selector(contactManager:
							   didRemoveContact:)
					   withObject: self
					   withObject: contact];
		return;
	}

	if (contact == nil) {
		contact = [[XMPPContact new] autorelease];
		[contact XMPP_setRosterItem: rosterItem];
		[_contacts setObject: contact
			     forKey: bareJID];
		[_delegates broadcastSelector: @selector(contactManager:
						   didAddContact:)
				   withObject: self
				   withObject: contact];
	} else {
		[_delegates broadcastSelector: @selector(contact:
						   willUpdateWithRosterItem:)
				   withObject: contact
				   withObject: rosterItem];
		[contact XMPP_setRosterItem: rosterItem];
	}
}

-   (void)connection: (XMPPConnection*)connection
  didReceivePresence: (XMPPPresence*)presence
{
	XMPPJID *JID = [presence from];
	XMPPContact *contact = [_contacts objectForKey: [JID bareJID]];

	if (contact == nil)
		return;

	// We only care for available and unavailable here, not subscriptions
	if ([[presence type] isEqual: @"available"]) {
		[contact XMPP_setPresence: presence
				 resource: [JID resource]];
		[_delegates broadcastSelector: @selector(contact:
						   didSendPresence:)
				   withObject: contact
				   withObject: presence];
	} else if ([[presence type] isEqual: @"unavailable"]) {
		[contact XMPP_removePresenceForResource: [JID resource]];
		[_delegates broadcastSelector: @selector(contact:
						   didSendPresence:)
				   withObject: contact
				   withObject: presence];
	}
}

-  (void)connection: (XMPPConnection*)connection
  didReceiveMessage: (XMPPMessage*)message