ObjXMPP  Check-in [f86a1460d0]

Overview
Comment:Adjust exceptions to ObjFW API change.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f86a1460d05b87d9022ab74db9c30f26f4e8054f2e11212fb85ac1a6edc38737
User & Date: js on 2013-11-22 20:21:56
Other Links: manifest | tags
Context
2014-02-03
22:34
Adapt to ObjFW changes check-in: 0668df366c user: florob@babelmonkeys.de tags: trunk
2013-11-22
20:21
Adjust exceptions to ObjFW API change. check-in: f86a1460d0 user: js tags: trunk
2013-07-01
20:49
Update buildsys. check-in: 63dbedd5a9 user: js tags: trunk
Changes

Modified src/XMPPExceptions.h from [8c68d97891] to [0c1c187111].

31
32
33
34
35
36
37
38

39
40
41
42
43
44
45
31
32
33
34
35
36
37

38
39
40
41
42
43
44
45







-
+







@interface XMPPException: OFException
{
	XMPPConnection *_connection;
}

#ifdef OF_HAVE_PROPERTIES
/// \brief The connection the exception relates to
@property (readonly, assign) XMPPConnection *connection;
@property (readonly, retain) XMPPConnection *connection;
#endif

/**
 * \brief Creates a new XMPPException.
 *
 * \param connection The connection that received the data responsible
 *	  for this exception
65
66
67
68
69
70
71
72

73
74

75
76
77
78
79
80
81
65
66
67
68
69
70
71

72
73

74
75
76
77
78
79
80
81







-
+

-
+







@interface XMPPStreamErrorException: XMPPException
{
	OFString *_condition, *_reason;
}

#ifdef OF_HAVE_PROPERTIES
/// \brief The defined error condition specified by the stream error
@property (readonly, assign) OFString *condition;
@property (readonly, copy) OFString *condition;
/// \brief The descriptive free-form text specified by the stream error
@property (readonly, assign) OFString *reason;
@property (readonly, copy) OFString *reason;
#endif

/**
 * \brief Creates a new XMPPStreamErrorException.
 *
 * \param connection The connection that received the stream error
 * \param condition The defined error condition specified by the stream error
109
110
111
112
113
114
115
116

117
118

119
120
121
122
123
124
125
109
110
111
112
113
114
115

116
117

118
119
120
121
122
123
124
125







-
+

-
+







@interface XMPPStringPrepFailedException: XMPPException
{
	OFString *_profile, *_string;
}

#ifdef OF_HAVE_PROPERTIES
/// \brief The name of the stringprep profile that did not apply
@property (readonly, assign) OFString *profile;
@property (readonly, copy) OFString *profile;
/// \brief The string that failed the stringprep profile
@property (readonly, assign) OFString *string;
@property (readonly, copy) OFString *string;
#endif

/**
 * \brief Creates a new XMPPStringPrepFailedException.
 *
 * \param connection The connection the string relates to
 * \param profile The name of the stringprep profile that did not apply
152
153
154
155
156
157
158
159

160
161

162
163
164
165
166
167
168
152
153
154
155
156
157
158

159
160

161
162
163
164
165
166
167
168







-
+

-
+







@interface XMPPIDNATranslationFailedException: XMPPException
{
	OFString *_operation, *_string;
}

#ifdef OF_HAVE_PROPERTIES
/// \brief The IDNA translation operation which failed
@property (readonly, assign) OFString *operation;
@property (readonly, copy) OFString *operation;
/// \brief The string that could not be translated
@property (readonly, assign) OFString *string;
@property (readonly, copy) OFString *string;
#endif

/**
 * \brief Creates a new XMPPIDNATranslationFailedException.
 *
 * \param connection The connection the string relates to
 * \param operation The name of the stringprep profile that did not apply
195
196
197
198
199
200
201
202

203
204
205
206
207
208
209
195
196
197
198
199
200
201

202
203
204
205
206
207
208
209







-
+







@interface XMPPAuthFailedException: XMPPException
{
	OFString *_reason;
}

#ifdef OF_HAVE_PROPERTIES
/// \brief The reason the authentication failed
@property (readonly, assign) OFString *reason;
@property (readonly, copy) OFString *reason;
#endif

/**
 * \brief Creates a new XMPPAuthFailedException.
 *
 * \param connection The connection that could not be authenticated
 * \param reason The reason the authentication failed

Modified src/XMPPExceptions.m from [9a8f715d68] to [9acb94944f].

66
67
68
69
70
71
72
73

74
75
76
77
78
79
80
66
67
68
69
70
71
72

73
74
75
76
77
78
79
80







-
+







	[_connection release];

	[super dealloc];
}

- (XMPPConnection*)connection
{
	OF_GETTER(_connection, false)
	OF_GETTER(_connection, true)
}
@end

@implementation XMPPStreamErrorException
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
			      condition: (OFString*)condition
				 reason: (OFString*)reason;
125
126
127
128
129
130
131
132

133
134
135
136
137

138
139
140
141
142
143
144
125
126
127
128
129
130
131

132
133
134
135
136

137
138
139
140
141
142
143
144







-
+




-
+







{
	return [OFString stringWithFormat:
	    @"Got stream error: %@. Reason: %@!", _condition, _reason];
}

- (OFString*)condition
{
	OF_GETTER(_condition, false)
	OF_GETTER(_condition, true)
}

- (OFString*)reason
{
	OF_GETTER(_reason, false)
	OF_GETTER(_reason, true)
}
@end

@implementation XMPPStringPrepFailedException
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
				profile: (OFString*)profile
				 string: (OFString*)string
190
191
192
193
194
195
196
197

198
199
200
201
202

203
204
205
206
207
208
209
190
191
192
193
194
195
196

197
198
199
200
201

202
203
204
205
206
207
208
209







-
+




-
+







	return [OFString stringWithFormat:
	    @"Stringprep with profile %@ failed on string '%@'!",
	    _profile, _string];
}

- (OFString*)profile
{
	OF_GETTER(_profile, false)
	OF_GETTER(_profile, true)
}

- (OFString*)string
{
	OF_GETTER(_string, false)
	OF_GETTER(_string, true)
}
@end

@implementation XMPPIDNATranslationFailedException
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
			      operation: (OFString*)operation
				 string: (OFString*)string
254
255
256
257
258
259
260
261

262
263
264
265
266

267
268
269
270
271
272
273
254
255
256
257
258
259
260

261
262
263
264
265

266
267
268
269
270
271
272
273







-
+




-
+







{
	return [OFString stringWithFormat:
	    @"IDNA operation %@ failed on string '%@'!", _operation, _string];
}

- (OFString*)operation
{
	OF_GETTER(_operation, false)
	OF_GETTER(_operation, true)
}

- (OFString*)string
{
	OF_GETTER(_string, false)
	OF_GETTER(_string, true)
}
@end

@implementation XMPPAuthFailedException
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
				 reason: (OFString*)reason;
{
313
314
315
316
317
318
319
320

321
322
313
314
315
316
317
318
319

320
321
322







-
+


{
	return [OFString stringWithFormat:
	    @"Authentication failed. Reason: %@!", _reason];
}

- (OFString*)reason
{
	OF_GETTER(_reason, false)
	OF_GETTER(_reason, true)
}
@end