ObjXMPP  Check-in [6f1b17c116]

Overview
Comment:XMPPRoster: Ensure roster pushes were sent by the server
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6f1b17c11684a711a9e509ae81a97125d0707079e6b9a0d186c307f72d2d6112
User & Date: florob@babelmonkeys.de on 2014-02-03 22:50:41
Other Links: manifest | tags
Context
2014-02-03
23:00
XMPPConnection: Don't negotiate a session feature, when marked optional check-in: ad2e692fe7 user: florob@babelmonkeys.de tags: trunk
22:50
XMPPRoster: Ensure roster pushes were sent by the server check-in: 6f1b17c116 user: florob@babelmonkeys.de tags: trunk
22:36
XMPPConnection: Verify origin of IQ responses check-in: 4aae7b6dd1 user: florob@babelmonkeys.de tags: trunk
Changes

Modified src/XMPPRoster.m from [e703f5f457] to [26a9dc0c6a].

106
107
108
109
110
111
112

113
114
115
116
117
118
119
120
121





122
123
124
125
126
127
128

- (bool)connection: (XMPPConnection*)connection
      didReceiveIQ: (XMPPIQ*)iq
{
	OFXMLElement *rosterElement;
	OFXMLElement *element;
	XMPPRosterItem *rosterItem;


	rosterElement = [iq elementForName: @"query"
				 namespace: XMPP_NS_ROSTER];

	if (rosterElement == nil)
		return false;

	if (![[iq type] isEqual: @"set"])
		return false;






	element = [rosterElement elementForName: @"item"
				      namespace: XMPP_NS_ROSTER];

	if (element != nil) {
		rosterItem = [self XMPP_rosterItemWithXMLElement: element];








>









>
>
>
>
>







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134

- (bool)connection: (XMPPConnection*)connection
      didReceiveIQ: (XMPPIQ*)iq
{
	OFXMLElement *rosterElement;
	OFXMLElement *element;
	XMPPRosterItem *rosterItem;
	OFString *origin;

	rosterElement = [iq elementForName: @"query"
				 namespace: XMPP_NS_ROSTER];

	if (rosterElement == nil)
		return false;

	if (![[iq type] isEqual: @"set"])
		return false;

	// Ensure the roster push has been sent by the server
	origin = [[iq from] fullJID];
	if (origin != nil && ![origin isEqual: [[connection JID] bareJID]])
		return false;

	element = [rosterElement elementForName: @"item"
				      namespace: XMPP_NS_ROSTER];

	if (element != nil) {
		rosterItem = [self XMPP_rosterItemWithXMLElement: element];