|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: IMPS Protocol implementation for Presence Framework |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <badesca.h> |
|
20 |
|
21 #include <ximpbase.h> |
|
22 #include <ximpidentity.h> |
|
23 #include <ximpprotocolconnectionhost.h> |
|
24 |
|
25 #include "cimpsprotocolpresenceauthorization.h" |
|
26 #include "impsdebugprint.h" |
|
27 #include "cimpspluginconnectionmanager.h" |
|
28 |
|
29 #include "csubscribepresencegrantrequestlistrequest.h" |
|
30 #include "cgrantpresenceforpresentityrequest.h" |
|
31 #include "cupdatepresencegrantpifforpresentityrequest.h" |
|
32 #include "cwithdrawpresencegrantfrompresentityrequest.h" |
|
33 #include "cgrantpresenceforpresentitygroupmembersrequest.h" |
|
34 #include "cupdatepresencegrantpifforpresentitygroupmembersrequest.h" |
|
35 #include "cwithdrawpresencegrantfrompresentitygroupmembersrequest.h" |
|
36 #include "cgrantpresenceforeveryonerequest.h" |
|
37 #include "cupdatepresencegrantpifforeveryonerequest.h" |
|
38 #include "cwithdrawpresencegrantfromeveryonerequest.h" |
|
39 #include "csubscribepresenceblocklistrequest.h" |
|
40 #include "cblockpresenceforpresentityrequest.h" |
|
41 #include "ccancelpresenceblockfrompresentityrequest.h" |
|
42 #include "cpresenceauthuserrequest.h" |
|
43 #include "impspluginpanics.h" |
|
44 |
|
45 |
|
46 // ======== MEMBER FUNCTIONS ======== |
|
47 |
|
48 // --------------------------------------------------------------------------- |
|
49 // CImpsConnection::GetInterface() |
|
50 // --------------------------------------------------------------------------- |
|
51 // |
|
52 TAny* CImpsProtocolPresenceAuthorization::GetInterface( TInt32 aInterfaceId, |
|
53 TIfGetOps aOptions ) |
|
54 { |
|
55 IMPS_DP( D_IMPS_LIT( "CImpsProtocolPresenceAuthorization::GetInterface() Start" ) ); |
|
56 if ( aInterfaceId == MProtocolPresenceAuthorization::KInterfaceId ) |
|
57 { |
|
58 MProtocolPresenceAuthorization* self = this; |
|
59 return self; |
|
60 } |
|
61 |
|
62 if ( aOptions == MXIMPBase::EPanicIfUnknown ) |
|
63 { |
|
64 User::Panic( KImpsProtocolPresenceAuthorization, KErrExtensionNotSupported ); |
|
65 } |
|
66 IMPS_DP( D_IMPS_LIT( "CImpsProtocolPresenceAuthorization::GetInterface() End" ) ); |
|
67 return NULL; |
|
68 } |
|
69 |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // CImpsConnection::GetInterface() |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 const TAny* CImpsProtocolPresenceAuthorization::GetInterface( TInt32 aInterfaceId, |
|
76 TIfGetOps aOptions ) const |
|
77 { |
|
78 IMPS_DP( D_IMPS_LIT( "CImpsProtocolPresenceAuthorization::GetInterface() Start" ) ); |
|
79 if ( aInterfaceId == MProtocolPresenceAuthorization::KInterfaceId ) |
|
80 { |
|
81 const MProtocolPresenceAuthorization* self = this; |
|
82 return self; |
|
83 } |
|
84 |
|
85 if ( aOptions == MXIMPBase::EPanicIfUnknown ) |
|
86 { |
|
87 User::Panic( KImpsProtocolPresenceAuthorization, KErrExtensionNotSupported ); |
|
88 } |
|
89 IMPS_DP( D_IMPS_LIT( "CImpsProtocolPresenceAuthorization::GetInterface() End" ) ); |
|
90 return NULL; |
|
91 } |
|
92 |
|
93 |
|
94 // --------------------------------------------------------------------------- |
|
95 // CImpsConnection::NewInstanceLC() |
|
96 // --------------------------------------------------------------------------- |
|
97 // |
|
98 TInt32 CImpsProtocolPresenceAuthorization::GetInterfaceId() const |
|
99 { |
|
100 IMPS_DP( D_IMPS_LIT( "CImpsProtocolPresenceAuthorization::GetInterfaceId() Start-End" ) ); |
|
101 return MProtocolPresenceAuthorization::KInterfaceId; |
|
102 } |
|
103 |
|
104 |
|
105 |
|
106 // --------------------------------------------------------------------------- |
|
107 // CImpsProtocolPresenceAuthorization::CImpsProtocolPresenceAuthorization() |
|
108 // --------------------------------------------------------------------------- |
|
109 // |
|
110 CImpsProtocolPresenceAuthorization::CImpsProtocolPresenceAuthorization( |
|
111 MImpsPrtPluginConnectionManager& aConnMan ) |
|
112 : iConnMan( aConnMan ) |
|
113 { |
|
114 IMPS_DP( D_IMPS_LIT( "::CImpsProtocolPresenceAuthorization() Start-End" ) ); |
|
115 } |
|
116 |
|
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // CImpsProtocolPresenceAuthorization::ConstructL() |
|
120 // --------------------------------------------------------------------------- |
|
121 // |
|
122 void CImpsProtocolPresenceAuthorization::ConstructL() |
|
123 { |
|
124 IMPS_DP( D_IMPS_LIT( "CImpsProtocolPresenceAuthorization::ConstructL() Start" ) ); |
|
125 IMPS_DP( D_IMPS_LIT( "CImpsProtocolPresenceAuthorization::ConstructL() End" ) ); |
|
126 } |
|
127 |
|
128 |
|
129 // --------------------------------------------------------------------------- |
|
130 // CImpsProtocolPresenceAuthorization::NewL() |
|
131 // --------------------------------------------------------------------------- |
|
132 // |
|
133 CImpsProtocolPresenceAuthorization* CImpsProtocolPresenceAuthorization::NewL( |
|
134 MImpsPrtPluginConnectionManager& aConnMan ) |
|
135 { |
|
136 IMPS_DP( D_IMPS_LIT( "CImpsProtocolPresenceAuthorization::NewL() Start" ) ); |
|
137 |
|
138 CImpsProtocolPresenceAuthorization* self = |
|
139 new( ELeave ) CImpsProtocolPresenceAuthorization( aConnMan ); |
|
140 CleanupStack::PushL( self ); |
|
141 self->ConstructL(); |
|
142 CleanupStack::Pop( self ); |
|
143 |
|
144 IMPS_DP( D_IMPS_LIT( "CImpsProtocolPresenceAuthorization::NewL() End" ) ); |
|
145 return self; |
|
146 } |
|
147 |
|
148 |
|
149 // --------------------------------------------------------------------------- |
|
150 // CImpsProtocolPresenceAuthorization::~CImpsProtocolPresenceAuthorization() |
|
151 // --------------------------------------------------------------------------- |
|
152 // |
|
153 CImpsProtocolPresenceAuthorization::~CImpsProtocolPresenceAuthorization() |
|
154 { |
|
155 IMPS_DP( D_IMPS_LIT( "Authorization::~CImpsProtocolPresenceAuthorization() Start" ) ); |
|
156 |
|
157 |
|
158 IMPS_DP( D_IMPS_LIT( "Authorization::~CImpsProtocolPresenceAuthorization() End" ) ); |
|
159 } |
|
160 |
|
161 |
|
162 // --------------------------------------------------------------------------- |
|
163 // CImpsProtocolPresenceAuthorization::DoUnsubscribePresenceWatcherListL() |
|
164 // --------------------------------------------------------------------------- |
|
165 // |
|
166 void CImpsProtocolPresenceAuthorization::DoSubscribePresenceGrantRequestListL( |
|
167 TXIMPRequestId aReqId ) |
|
168 { |
|
169 IMPS_DP( D_IMPS_LIT( "Authorization::DoSubscribePresenceGrantRequestListL() Start" ) ); |
|
170 |
|
171 CreateDataHandlerL(); |
|
172 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
173 |
|
174 CSubscribePresenceGrantRequestListRequest* req = |
|
175 CSubscribePresenceGrantRequestListRequest::NewLC( iConnMan, aReqId ); |
|
176 |
|
177 CleanupStack::Check( req ); |
|
178 |
|
179 req->SubscribePresenceGrantRequestListL(); |
|
180 |
|
181 iConnMan.AddRequest( req ); |
|
182 CleanupStack::Pop( req ); |
|
183 |
|
184 IMPS_DP( D_IMPS_LIT( "Authorization::DoSubscribePresenceGrantRequestListL() End" ) ); |
|
185 } |
|
186 |
|
187 // --------------------------------------------------------------------------- |
|
188 // CImpsProtocolPresenceAuthorization::DoUnsubscribePresenceWatcherListL() |
|
189 // --------------------------------------------------------------------------- |
|
190 // |
|
191 void CImpsProtocolPresenceAuthorization::DoUnsubscribePresenceGrantRequestListL( |
|
192 TXIMPRequestId aReqId ) |
|
193 { |
|
194 IMPS_DP( D_IMPS_LIT( "Authorization::DoUnsubscribePresenceGrantRequestListL() Start" ) ); |
|
195 |
|
196 // complete the request successfully |
|
197 iConnMan.HandleToHost().HandleRequestCompleted( aReqId, KErrNone ); |
|
198 |
|
199 IMPS_DP( D_IMPS_LIT( "Authorization::DoUnsubscribePresenceGrantRequestListL() End" ) ); |
|
200 } |
|
201 |
|
202 // --------------------------------------------------------------------------- |
|
203 // CImpsProtocolPresenceAuthorization::DoGrantPresenceForPresentityL() |
|
204 // --------------------------------------------------------------------------- |
|
205 // |
|
206 void CImpsProtocolPresenceAuthorization::DoGrantPresenceForPresentityL( |
|
207 const MXIMPIdentity & aIdentity, |
|
208 const MPresenceInfoFilter & aPif, |
|
209 TXIMPRequestId aReqId ) |
|
210 { |
|
211 IMPS_DP( D_IMPS_LIT( "Authorization::DoGrantPresenceForPresentityL() Start" ) ); |
|
212 iRequestId = aReqId; |
|
213 |
|
214 CreateDataHandlerL(); |
|
215 HBufC* PresentityName; |
|
216 // find to the iPendingReactiveAuthPresenceGrantList array |
|
217 PresentityName = aIdentity.Identity().AllocL(); |
|
218 TInt index = iConnMan.PresenceAuthGrantReqList()->Find( *PresentityName ); |
|
219 TInt count = iConnMan.PresenceAuthGrantReqList()->Count(); |
|
220 delete PresentityName; |
|
221 if ( index != KErrNotFound ) |
|
222 { |
|
223 IMPS_DP( D_IMPS_LIT( "iPresenceAuthGrantReqList Find returns %d" ), index ); |
|
224 |
|
225 // send response to presence-auth request to the server |
|
226 SendResponseForReactiveAuthRequestL( aIdentity, aPif, aReqId ); |
|
227 |
|
228 return; |
|
229 } |
|
230 |
|
231 IMPS_DP( D_IMPS_LIT( " No pending ReactiveAuthrequest " ) ); |
|
232 |
|
233 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
234 |
|
235 CGrantPresenceForPresentityRequest* req = |
|
236 CGrantPresenceForPresentityRequest::NewLC( iConnMan, aReqId ); |
|
237 |
|
238 CleanupStack::Check( req ); |
|
239 |
|
240 req->GrantPresenceForPresentityL( aIdentity, aPif ); |
|
241 |
|
242 iConnMan.AddRequest( req ); |
|
243 CleanupStack::Pop( req ); |
|
244 |
|
245 IMPS_DP( D_IMPS_LIT( "Authorization::DoGrantPresenceForPresentityL() End" ) ); |
|
246 } |
|
247 |
|
248 // --------------------------------------------------------------------------- |
|
249 // CImpsProtocolPresenceAuthorization::DoUpdateGrantPresenceForPresentityL() |
|
250 // --------------------------------------------------------------------------- |
|
251 // |
|
252 void CImpsProtocolPresenceAuthorization::DoUpdatePresenceGrantPifForPresentityL( |
|
253 const MXIMPIdentity &aIdentity, |
|
254 const MPresenceInfoFilter &aPif, |
|
255 TXIMPRequestId aReqId ) |
|
256 { |
|
257 IMPS_DP( D_IMPS_LIT( "Authorization::DoUpdatePresenceGrantPifForPresentityL() Start" ) ); |
|
258 |
|
259 iRequestId = aReqId; |
|
260 |
|
261 CreateDataHandlerL(); |
|
262 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
263 |
|
264 CUpdatePresenceGrantPifForPresentityRequest* req = |
|
265 CUpdatePresenceGrantPifForPresentityRequest::NewLC( iConnMan, aReqId ); |
|
266 |
|
267 CleanupStack::Check( req ); |
|
268 |
|
269 req->UpdatePresenceGrantPifForPresentityL( aIdentity, aPif ); |
|
270 |
|
271 iConnMan.AddRequest( req ); |
|
272 CleanupStack::Pop( req ); |
|
273 |
|
274 |
|
275 IMPS_DP( D_IMPS_LIT( "Authorization::DoUpdatePresenceGrantPifForPresentityL() End" ) ); |
|
276 } |
|
277 |
|
278 // --------------------------------------------------------------------------- |
|
279 // CImpsProtocolPresenceAuthorization::DoUpdateGrantPresenceForPresentityGroupMembersL() |
|
280 // --------------------------------------------------------------------------- |
|
281 // |
|
282 void CImpsProtocolPresenceAuthorization::DoWithdrawPresenceGrantFromPresentityL( |
|
283 const MXIMPIdentity &aIdentity, |
|
284 TXIMPRequestId aReqId ) |
|
285 { |
|
286 IMPS_DP( D_IMPS_LIT( "Authorization::DoWithdrawPresenceGrantFromPresentityL() Start" ) ); |
|
287 |
|
288 iRequestId = aReqId; |
|
289 |
|
290 CreateDataHandlerL(); |
|
291 |
|
292 // Append to the iWithDrawnPresenceGrantList array |
|
293 |
|
294 // check for pending reactive authorization requests |
|
295 |
|
296 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
297 |
|
298 CWithdrawPresenceGrantFromPresentityRequest* req = |
|
299 CWithdrawPresenceGrantFromPresentityRequest::NewLC( iConnMan, aReqId ); |
|
300 |
|
301 CleanupStack::Check( req ); |
|
302 |
|
303 req->WithdrawPresenceGrantFromPresentityL( aIdentity ); |
|
304 |
|
305 iConnMan.AddRequest( req ); |
|
306 CleanupStack::Pop( req ); |
|
307 |
|
308 // remove from the array |
|
309 //TInt removestatus = iWithDrawnPresenceGrantList.Remove(findstatus); |
|
310 |
|
311 IMPS_DP( D_IMPS_LIT( "Authorization::DoWithdrawPresenceGrantFromPresentityL() End" ) ); |
|
312 } |
|
313 |
|
314 // --------------------------------------------------------------------------- |
|
315 // CImpsProtocolPresenceAuthorization::DoGrantPresenceForPresentityGroupMembersL() |
|
316 // --------------------------------------------------------------------------- |
|
317 // |
|
318 void CImpsProtocolPresenceAuthorization::DoGrantPresenceForPresentityGroupMembersL( |
|
319 const MXIMPIdentity &aIdentity, |
|
320 const MPresenceInfoFilter &aPif, |
|
321 TXIMPRequestId aReqId ) |
|
322 { |
|
323 IMPS_DP( D_IMPS_LIT( "Authorization::DoGrantPresenceForPresentityGroupMembersL() Start" ) ); |
|
324 |
|
325 iRequestId = aReqId; |
|
326 |
|
327 CreateDataHandlerL(); |
|
328 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
329 |
|
330 CGrantPresenceForPresentityGroupMembersRequest* req = |
|
331 CGrantPresenceForPresentityGroupMembersRequest::NewLC( iConnMan, aReqId ); |
|
332 |
|
333 CleanupStack::Check( req ); |
|
334 |
|
335 req->GrantPresenceForPresentityGroupMembersL( aIdentity, aPif ); |
|
336 |
|
337 iConnMan.AddRequest( req ); |
|
338 CleanupStack::Pop( req ); |
|
339 |
|
340 IMPS_DP( D_IMPS_LIT( "Authorization::DoGrantPresenceForPresentityGroupMembersL() End" ) ); |
|
341 } |
|
342 |
|
343 // --------------------------------------------------------------------------- |
|
344 // CImpsProtocolPresenceAuthorization::DoUpdateGrantPresenceForPresentityGroupMembersL() |
|
345 // --------------------------------------------------------------------------- |
|
346 // |
|
347 void CImpsProtocolPresenceAuthorization::DoUpdatePresenceGrantPifForPresentityGroupMembersL( |
|
348 const MXIMPIdentity &aIdentity, |
|
349 const MPresenceInfoFilter &aPif, |
|
350 TXIMPRequestId aReqId ) |
|
351 { |
|
352 IMPS_DP( D_IMPS_LIT( "DoUpdatePresenceGrantPifForPresentityGroupMembersL() Start" ) ); |
|
353 |
|
354 iRequestId = aReqId; |
|
355 |
|
356 CreateDataHandlerL(); |
|
357 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
358 |
|
359 CUpdatePresenceGrantPifForPresentityGroupMembersRequest* req = |
|
360 CUpdatePresenceGrantPifForPresentityGroupMembersRequest::NewLC( iConnMan, aReqId ); |
|
361 |
|
362 CleanupStack::Check( req ); |
|
363 |
|
364 req->UpdatePresenceGrantPifForPresentityGroupMembersL( aIdentity, aPif ); |
|
365 |
|
366 iConnMan.AddRequest( req ); |
|
367 CleanupStack::Pop( req ); |
|
368 |
|
369 IMPS_DP( D_IMPS_LIT( "DoUpdatePresenceGrantPifForPresentityGroupMembersL() End" ) ); |
|
370 } |
|
371 |
|
372 |
|
373 // --------------------------------------------------------------------------- |
|
374 // CImpsProtocolPresenceAuthorization::DoUpdateGrantPresenceForPresentityGroupMembersL() |
|
375 // --------------------------------------------------------------------------- |
|
376 // |
|
377 void CImpsProtocolPresenceAuthorization::DoWithdrawPresenceGrantFromPresentityGroupMembersL( |
|
378 const MXIMPIdentity &aIdentity, |
|
379 TXIMPRequestId aReqId ) |
|
380 { |
|
381 IMPS_DP( D_IMPS_LIT( "DoWithdrawPresenceGrantFromPresentityGroupMembersL() Start" ) ); |
|
382 |
|
383 iRequestId = aReqId; |
|
384 |
|
385 CreateDataHandlerL(); |
|
386 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
387 |
|
388 CWithdrawPresenceGrantFromPresentityGroupMembersRequest* req = |
|
389 CWithdrawPresenceGrantFromPresentityGroupMembersRequest::NewLC( iConnMan, aReqId ); |
|
390 |
|
391 CleanupStack::Check( req ); |
|
392 |
|
393 req->WithdrawPresenceGrantFromPresentityGroupMembersL( aIdentity ); |
|
394 |
|
395 iConnMan.AddRequest( req ); |
|
396 CleanupStack::Pop( req ); |
|
397 |
|
398 IMPS_DP( D_IMPS_LIT( "DoWithdrawPresenceGrantFromPresentityGroupMembersL() End" ) ); |
|
399 } |
|
400 |
|
401 // --------------------------------------------------------------------------- |
|
402 // CImpsProtocolPresenceAuthorization::DoGrantPresenceForEveryoneL() |
|
403 // --------------------------------------------------------------------------- |
|
404 // |
|
405 void CImpsProtocolPresenceAuthorization::DoGrantPresenceForEveryoneL( |
|
406 const MPresenceInfoFilter& aPif, |
|
407 TXIMPRequestId aReqId ) |
|
408 { |
|
409 IMPS_DP( D_IMPS_LIT( "Authorization::DoGrantPresenceForEveryoneL() Start" ) ); |
|
410 |
|
411 iRequestId = aReqId; |
|
412 |
|
413 CreateDataHandlerL(); |
|
414 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
415 |
|
416 CGrantPresenceForEveryoneRequest* req = |
|
417 CGrantPresenceForEveryoneRequest::NewLC( iConnMan, aReqId ); |
|
418 |
|
419 CleanupStack::Check( req ); |
|
420 |
|
421 req->GrantPresenceForEveryoneL( aPif ); |
|
422 |
|
423 iConnMan.AddRequest( req ); |
|
424 CleanupStack::Pop( req ); |
|
425 |
|
426 IMPS_DP( D_IMPS_LIT( "Authorization::DoGrantPresenceForEveryoneL() End" ) ); |
|
427 } |
|
428 |
|
429 // --------------------------------------------------------------------------- |
|
430 // CImpsProtocolPresenceAuthorization::DoUpdatePresenceGrantPifForEveryoneL() |
|
431 // --------------------------------------------------------------------------- |
|
432 // |
|
433 void CImpsProtocolPresenceAuthorization::DoUpdatePresenceGrantPifForEveryoneL( |
|
434 const MPresenceInfoFilter& aPif, |
|
435 TXIMPRequestId aReqId ) |
|
436 { |
|
437 IMPS_DP( D_IMPS_LIT( "Authorization::DoUpdatePresenceGrantPifForEveryoneL() Start" ) ); |
|
438 |
|
439 iRequestId = aReqId; |
|
440 |
|
441 CreateDataHandlerL(); |
|
442 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
443 |
|
444 CUpdatePresenceGrantPifForEveryoneRequest* req = |
|
445 CUpdatePresenceGrantPifForEveryoneRequest::NewLC( iConnMan, aReqId ); |
|
446 |
|
447 CleanupStack::Check( req ); |
|
448 |
|
449 req->UpdatePresenceGrantPifForEveryoneL( aPif ); |
|
450 |
|
451 iConnMan.AddRequest( req ); |
|
452 CleanupStack::Pop( req ); |
|
453 |
|
454 IMPS_DP( D_IMPS_LIT( "Authorization::DoUpdatePresenceGrantPifForEveryoneL() End" ) ); |
|
455 } |
|
456 |
|
457 // --------------------------------------------------------------------------- |
|
458 // CImpsProtocolPresenceAuthorization::DoWithdrawPresenceGrantFromEveryoneL() |
|
459 // --------------------------------------------------------------------------- |
|
460 // |
|
461 void CImpsProtocolPresenceAuthorization::DoWithdrawPresenceGrantFromEveryoneL( |
|
462 TXIMPRequestId aReqId ) |
|
463 { |
|
464 IMPS_DP( D_IMPS_LIT( "Authorization::DoWithdrawPresenceGrantFromEveryoneL() Start" ) ); |
|
465 |
|
466 iRequestId = aReqId; |
|
467 |
|
468 CreateDataHandlerL(); |
|
469 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
470 |
|
471 CWithdrawPresenceGrantFromEveryoneRequest* req = |
|
472 CWithdrawPresenceGrantFromEveryoneRequest::NewLC( iConnMan, aReqId ); |
|
473 |
|
474 CleanupStack::Check( req ); |
|
475 |
|
476 req->WithdrawPresenceGrantFromEveryoneL(); |
|
477 |
|
478 iConnMan.AddRequest( req ); |
|
479 CleanupStack::Pop( req ); |
|
480 |
|
481 |
|
482 IMPS_DP( D_IMPS_LIT( "Authorization::DoWithdrawPresenceGrantFromEveryoneL() End" ) ); |
|
483 } |
|
484 |
|
485 // --------------------------------------------------------------------------- |
|
486 // CImpsProtocolPresenceAuthorization::DoSubscribePresenceBlockListL() |
|
487 // --------------------------------------------------------------------------- |
|
488 // |
|
489 void CImpsProtocolPresenceAuthorization::DoSubscribePresenceBlockListL( |
|
490 TXIMPRequestId aReqId ) |
|
491 { |
|
492 IMPS_DP( D_IMPS_LIT( "Authorization::DoSubscribePresenceBlockListL() Start" ) ); |
|
493 |
|
494 iRequestId = aReqId; |
|
495 |
|
496 CreateDataHandlerL(); |
|
497 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
498 |
|
499 CSubscribePresenceBlockListRequest* req = |
|
500 CSubscribePresenceBlockListRequest::NewLC( iConnMan, aReqId ); |
|
501 |
|
502 CleanupStack::Check( req ); |
|
503 |
|
504 req->SubscribePresenceBlockListL(); |
|
505 |
|
506 iConnMan.AddRequest( req ); |
|
507 CleanupStack::Pop( req ); |
|
508 |
|
509 IMPS_DP( D_IMPS_LIT( "Authorization::DoSubscribePresenceBlockListL() End" ) ); |
|
510 } |
|
511 |
|
512 |
|
513 // --------------------------------------------------------------------------- |
|
514 // CImpsProtocolPresenceAuthorization::DoUnsubscribePresenceBlockListL() |
|
515 // --------------------------------------------------------------------------- |
|
516 // |
|
517 void CImpsProtocolPresenceAuthorization::DoUnsubscribePresenceBlockListL( |
|
518 TXIMPRequestId aReqId ) |
|
519 { |
|
520 IMPS_DP( D_IMPS_LIT( "Authorization::DoUnsubscribePresenceBlockListL() Start" ) ); |
|
521 |
|
522 // complete the request successfully |
|
523 iConnMan.HandleToHost().HandleRequestCompleted( aReqId, KErrNone ); |
|
524 |
|
525 IMPS_DP( D_IMPS_LIT( "Authorization::DoUnsubscribePresenceBlockListL() End" ) ); |
|
526 } |
|
527 |
|
528 |
|
529 // --------------------------------------------------------------------------- |
|
530 // CImpsProtocolPresenceAuthorization::DoBlockPresenceForPresentityL() |
|
531 // --------------------------------------------------------------------------- |
|
532 // |
|
533 void CImpsProtocolPresenceAuthorization::DoBlockPresenceForPresentityL( |
|
534 const MXIMPIdentity& aPresentityId, |
|
535 TXIMPRequestId aReqId ) |
|
536 { |
|
537 IMPS_DP( D_IMPS_LIT( "Authorization::DoBlockPresenceForPresentityL() Start" ) ); |
|
538 |
|
539 CreateDataHandlerL(); |
|
540 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
541 |
|
542 CBlockPresenceForPresentityRequest* req = |
|
543 CBlockPresenceForPresentityRequest::NewLC( iConnMan, aReqId ); |
|
544 |
|
545 CleanupStack::Check( req ); |
|
546 |
|
547 req->BlockPresenceForPresentityL( aPresentityId ); |
|
548 |
|
549 iConnMan.AddRequest( req ); |
|
550 CleanupStack::Pop( req ); |
|
551 |
|
552 IMPS_DP( D_IMPS_LIT( "Authorization::DoBlockPresenceForPresentityL() End" ) ); |
|
553 } |
|
554 |
|
555 // --------------------------------------------------------------------------- |
|
556 // CImpsProtocolPresenceAuthorization::DoCancelPresenceBlockFromPresentityL() |
|
557 // --------------------------------------------------------------------------- |
|
558 // |
|
559 void CImpsProtocolPresenceAuthorization::DoCancelPresenceBlockFromPresentityL( |
|
560 const MXIMPIdentity& aPresentityId, |
|
561 TXIMPRequestId aReqId ) |
|
562 { |
|
563 IMPS_DP( D_IMPS_LIT( "Authorization::DoCancelPresenceBlockFromPresentityL() Start" ) ); |
|
564 |
|
565 CreateDataHandlerL(); |
|
566 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
567 |
|
568 CCancelPresenceBlockFromPresentityRequest* req = |
|
569 CCancelPresenceBlockFromPresentityRequest::NewLC( iConnMan, aReqId ); |
|
570 |
|
571 CleanupStack::Check( req ); |
|
572 |
|
573 req->CancelPresenceBlockFromPresentityL( aPresentityId ); |
|
574 |
|
575 iConnMan.AddRequest( req ); |
|
576 CleanupStack::Pop( req ); |
|
577 |
|
578 IMPS_DP( D_IMPS_LIT( "Authorization::DoCancelPresenceBlockFromPresentityL() End" ) ); |
|
579 } |
|
580 |
|
581 // --------------------------------------------------------------------------- |
|
582 // CImpsProtocolPresenceAuthorization::CreateDataHandlerL() |
|
583 // --------------------------------------------------------------------------- |
|
584 // |
|
585 void CImpsProtocolPresenceAuthorization::CreateDataHandlerL() |
|
586 { |
|
587 IMPS_DP_TXT( "Authorization::CreateDataHandler() Start" ); |
|
588 if ( !( iConnMan.IsDataHandlerCreatedL() ) ) |
|
589 { |
|
590 iConnMan.ManufactureDataHandlerL(); |
|
591 } |
|
592 IMPS_DP_TXT( "Authorization::CreateDataHandler() End" ); |
|
593 } |
|
594 |
|
595 // --------------------------------------------------------------------------- |
|
596 // CImpsProtocolPresenceAuthorization::SendResponseForReactiveAuthRequestL() |
|
597 // --------------------------------------------------------------------------- |
|
598 // |
|
599 void CImpsProtocolPresenceAuthorization::SendResponseForReactiveAuthRequestL( |
|
600 const MXIMPIdentity & aIdentity, |
|
601 const MPresenceInfoFilter & aPif, |
|
602 TXIMPRequestId aReqId ) |
|
603 { |
|
604 IMPS_DP( D_IMPS_LIT( "Authorization::SendResponseForReactiveAuthRequestL() Start" ) ); |
|
605 |
|
606 // PresenceAuthUser Request |
|
607 |
|
608 CreateDataHandlerL(); |
|
609 iConnMan.ReserveSpaceForOneMoreRequestL(); |
|
610 |
|
611 CPresenceAuthUserRequest* req = |
|
612 CPresenceAuthUserRequest::NewLC( iConnMan, aReqId ); |
|
613 |
|
614 CleanupStack::Check( req ); |
|
615 |
|
616 req->PresenceAuthUserRequestL( aIdentity, aPif ); |
|
617 |
|
618 iConnMan.AddRequest( req ); |
|
619 CleanupStack::Pop( req ); |
|
620 |
|
621 IMPS_DP( D_IMPS_LIT( "Authorization::SendResponseForReactiveAuthRequestL() End" ) ); |
|
622 } |
|
623 |
|
624 // End of file |
|
625 |