Changeset 23111
- Timestamp:
- 04/12/2008 01:21:06 PM (7 months ago)
- Files:
-
- trunk/Frameworks/Adium Framework/Source/AIAbstractAccount.m (modified) (1 diff)
- trunk/Frameworks/Adium Framework/Source/AIAccount.h (modified) (2 diffs)
- trunk/Frameworks/Adium Framework/Source/AIAccount.m (modified) (2 diffs)
- trunk/Plugins/Purple Service/adiumPurpleAccounts.m (modified) (2 diffs)
- trunk/Plugins/Purple Service/CBPurpleAccount.m (modified) (2 diffs)
- trunk/Plugins/Purple Service/SLPurpleCocoaAdapter.h (modified) (1 diff)
- trunk/Plugins/Purple Service/SLPurpleCocoaAdapter.m (modified) (2 diffs)
- trunk/Source/ESAuthorizationRequestWindowController.h (modified) (1 diff)
- trunk/Source/ESAuthorizationRequestWindowController.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Frameworks/Adium Framework/Source/AIAbstractAccount.m
r22910 r23111 1093 1093 [self setStatusObject:nil forKey:@"ConnectionProgressPercent" notify:NotifyLater]; 1094 1094 [self setStatusObject:nil forKey:@"Waiting to Reconnect" notify:NotifyLater]; 1095 1095 AILogWithSignature(@"*** status dictionary is now %@", statusDictionary); 1096 1096 1097 //Apply any changes 1097 1098 [self notifyOfChangedStatusSilently:NO]; trunk/Frameworks/Adium Framework/Source/AIAccount.h
r22850 r23111 74 74 } AIPrivacyOption; 75 75 76 typedef enum { 77 AIAuthorizationNoResponse = 0, 78 AIAuthorizationDenied, 79 AIAuthorizationAllowed 80 } AIAuthorizationResponse; 81 76 82 //Support for file transfer 77 83 @protocol AIAccount_Files … … 209 215 - (void)promptToVerifyEncryptionIdentityInChat:(AIChat *)inChat; 210 216 217 /*! 218 * @brief Can the account send images inline within a chat? 219 */ 211 220 - (BOOL)canSendImagesForChat:(AIChat *)inChat; 212 221 213 - (void)authorizationWindowController:(NSWindowController *)inWindowController authorizationWithDict:(NSDictionary *)infoDict didAuthorize:(BOOL)inDidAuthorize; 222 /*! 223 * @brief An authorization prompt closed, granting or denying a contact's request for authorization 224 * 225 * @param inWindowController The window controller which closed; an account may have kept track of what windows were showing its authorization prompts 226 * @param inDict A dictionary of authorization information created by the account originally and possibly modified 227 * @param authorizationResponse An AIAuthorizationResponse indicating if authorization was granted or denied or if there was no response 228 */ 229 - (void)authorizationWindowController:(NSWindowController *)inWindowController authorizationWithDict:(NSDictionary *)infoDict response:(AIAuthorizationResponse)authorizationResponse; 214 230 215 231 -(NSMenu*)actionsForChat:(AIChat*)chat; trunk/Frameworks/Adium Framework/Source/AIAccount.m
r22850 r23111 801 801 802 802 #pragma mark Image sending 803 /*! 804 * @brief Can the account send images inline within a chat? 805 */ 803 806 - (BOOL)canSendImagesForChat:(AIChat *)inChat 804 807 { … … 812 815 * @param inWindowController The window controller which closed; an account may have kept track of what windows were showing its authorization prompts 813 816 * @param inDict A dictionary of authorization information created by the account originally and possibly modified 814 * @param inDidAuthorize YES if authorization was granted; NO if it was denied815 */ 816 - (void)authorizationWindowController:(NSWindowController *)inWindowController authorizationWithDict:(NSDictionary *)infoDict didAuthorize:(BOOL)inDidAuthorize817 * @param authorizationResponse An AIAuthorizationResponse indicating if authorization was granted or denied or if there was no response 818 */ 819 - (void)authorizationWindowController:(NSWindowController *)inWindowController authorizationWithDict:(NSDictionary *)infoDict response:(AIAuthorizationResponse)authorizationResponse; 817 820 {} 818 821 trunk/Plugins/Purple Service/adiumPurpleAccounts.m
r23026 r23111 59 59 60 60 //Note that CBPurpleAccount will retain ownership of this object to keep it around for us in case adiumPurpleAccountRequestClose() is called. 61 return [accountLookup(account) authorizationRequestWithDict:infoDict]; ;61 return [accountLookup(account) authorizationRequestWithDict:infoDict]; 62 62 } 63 63 … … 66 66 id ourHandle = (id)ui_handle; 67 67 68 if ([ourHandle respondsToSelector:@selector(purpleRequestClose)]) { 69 [ourHandle performSelector:@selector(purpleRequestClose)]; 70 71 } else if ([ourHandle respondsToSelector:@selector(closeWindow:)]) { 72 [ourHandle performSelector:@selector(closeWindow:) 73 withObject:nil]; 74 } 68 //Close the window 69 [ourHandle performSelector:@selector(closeWindow:) 70 withObject:nil]; 71 72 //Then release our reference to the handle, since adiumPurpleAccountRequestAuthorize() returned a retained object 73 [ourHandle release]; 75 74 } 76 75 trunk/Plugins/Purple Service/CBPurpleAccount.m
r23029 r23111 394 394 purpleUserInfo = [self processedIncomingUserInfo:purpleUserInfo]; 395 395 396 AILogWithSignature(@"Decoded %@ to %@", purpleUserInfo, [AIHTMLDecoder decodeHTML:purpleUserInfo]); 396 397 [theContact setProfile:[AIHTMLDecoder decodeHTML:purpleUserInfo] 397 398 notify:NotifyLater]; … … 607 608 //We will release the returned window controller in -[self authorizationWindowController:authorizationWithDict:didAuthorize:] 608 609 return [[[[AIObject sharedAdiumInstance] contactController] showAuthorizationRequestWithDict:dict 609 forAccount:self] autorelease]; 610 } 611 612 - (void)authorizationWindowController:(NSWindowController *)inWindowController authorizationWithDict:(NSDictionary *)infoDict didAuthorize:(BOOL)inDidAuthorize 613 { 614 id callback; 615 610 forAccount:self] retain]; 611 } 612 613 - (void)authorizationWindowController:(NSWindowController *)inWindowController authorizationWithDict:(NSDictionary *)infoDict response:(AIAuthorizationResponse)authorizationResponse 614 { 616 615 if (account) { 617 if (inDidAuthorize) { 618 callback = [[[infoDict objectForKey:@"authorizeCB"] retain] autorelease]; 616 id callback; 617 618 switch (authorizationResponse) { 619 case AIAuthorizationAllowed: 620 callback = [[[infoDict objectForKey:@"authorizeCB"] retain] autorelease]; 621 break; 622 case AIAuthorizationDenied: 623 callback = [[[infoDict objectForKey:@"denyCB"] retain] autorelease]; 624 break; 625 case AIAuthorizationNoResponse: 626 callback = nil; 627 break; 628 } 629 630 //libpurple will remove its reference to the handle for this request, which is inWindowController, in response to this callback invocation 631 if (callback) { 632 [purpleThread doAuthRequestCbValue:callback withUserDataValue:[[[infoDict objectForKey:@"userData"] retain] autorelease]]; 633 634 /* Retained in -[self authorizationRequestWithDict:]. We kept it around before now in case libpurle wanted us to close it early, such as because the 635 * account disconnected. 636 */ 637 [inWindowController autorelease]; 619 638 } else { 620 callback = [[[infoDict objectForKey:@"denyCB"] retain] autorelease]; 639 [purpleThread closeAuthRequestWithHandle:inWindowController]; 640 621 641 } 622 623 //libpurple will remove its reference to the handle for this request, which is inWindowController, in response to this callback invocation 624 [purpleThread doAuthRequestCbValue:callback withUserDataValue:[[[infoDict objectForKey:@"userData"] retain] autorelease]]; 625 } 626 627 /* Retained in -[self authorizationRequestWithDict:]. We kept it around before now in case libpurle wanted us to close it early, such as because the 628 * account disconnected. 629 */ 630 [inWindowController autorelease]; 642 } 631 643 } 632 644 trunk/Plugins/Purple Service/SLPurpleCocoaAdapter.h
r22832 r23111 94 94 95 95 - (void)doAuthRequestCbValue:(NSValue *)inCallBackValue withUserDataValue:(NSValue *)inUserDataValue; 96 - (void)closeAuthRequestWithHandle:(id)authRequestHandle; 96 97 - (BOOL)doCommand:(NSString *)originalMessage fromAccount:(id)sourceAccount inChat:(AIChat *)chat; 97 98 trunk/Plugins/Purple Service/SLPurpleCocoaAdapter.m
r22998 r23111 1387 1387 1388 1388 /*! 1389 * @brief Call the purple callback to finish up the window1389 * @brief Call the purple callback to pass on an authorization response 1390 1390 * 1391 1391 * @param inCallBackValue The cb to use … … 1400 1400 } 1401 1401 1402 /*! 1403 * @brief Tell purple we closed an authorization request without a response 1404 */ 1405 - (void)closeAuthRequestWithHandle:(id)authRequestHandle 1406 { 1407 purple_account_request_close(authRequestHandle); 1408 } 1409 1402 1410 #pragma mark Secure messaging 1403 1411 trunk/Source/ESAuthorizationRequestWindowController.h
r21944 r23111 24 24 25 25 BOOL windowIsClosing; 26 BOOL postedAuthorizationResponse; 26 27 } 27 28 trunk/Source/ESAuthorizationRequestWindowController.m
r21943 r23111 110 110 windowIsClosing = YES; 111 111 112 if (!postedAuthorizationResponse) { 113 [account authorizationWindowController:self 114 authorizationWithDict:infoDict 115 response:AIAuthorizationNoResponse]; 116 } 117 112 118 [super windowWillClose:sender]; 113 119 … … 125 131 - (IBAction)authorize:(id)sender 126 132 { 133 postedAuthorizationResponse = YES; 134 127 135 //Do the authorization serverside 128 136 [account authorizationWindowController:self 129 137 authorizationWithDict:infoDict 130 didAuthorize:YES];138 response:AIAuthorizationAllowed]; 131 139 132 140 //Now handle the Add To Contact List checkbox … … 146 154 - (IBAction)deny:(id)sender 147 155 { 156 postedAuthorizationResponse = YES; 157 148 158 [account authorizationWindowController:self 149 159 authorizationWithDict:infoDict 150 didAuthorize:NO];160 response:AIAuthorizationDenied]; 151 161 152 162 [infoDict release]; infoDict = nil;