Changeset 5545

Show
Ignore:
Timestamp:
05/30/08 00:17:30 (3 months ago)
Author:
morris
Message:

Present a client not found error if attempting to reply to a client that doesn't exist

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/English.lproj/Localizable.strings

    r5542 r5545  
    197197"Chat received" = "Chat received"; 
    198198 
    199 /* Wired Protocol error 522 title 
    200    Error */ 
     199/* WCWiredClientChecksumMismatch title 
     200   Wired Protocol error 522 title */ 
    201201"Checksum Mismatch" = "Checksum Mismatch"; 
    202202 
     
    205205"Clear" = "Clear"; 
    206206 
    207 /* Wired Protocol error 512 title */ 
     207/* WCWiredClientClientNotFound title 
     208   Wired Protocol error 512 title */ 
    208209"Client Not Found" = "Client Not Found"; 
    209210 
     
    232233"Cool" = "Cool"; 
    233234 
    234 /* Error (path) */ 
     235/* WCWiredClientCreateFailed description (path) */ 
    235236"Could not create the file \"%@\"." = "Could not create the file \"%@\"."; 
    236237 
     
    241242"Could not find the account you referred to. Perhaps someone deleted it." = "Could not find the account you referred to. Perhaps someone deleted it."; 
    242243 
    243 /* Wired Protocol error 512 description */ 
     244/* WCWiredClientClientNotFound description 
     245   Wired Protocol error 512 description */ 
    244246"Could not find the client you referred to. Perhaps that client left before the command could be completed." = "Could not find the client you referred to. Perhaps that client left before the command could be completed."; 
    245247 
     
    253255"Could not login, you are banned from this server." = "Could not login, you are banned from this server."; 
    254256 
    255 /* Error (path) */ 
     257/* WCWiredClientOpenFailed description (path) */ 
    256258"Could not open the file \"%@\"." = "Could not open the file \"%@\"."; 
    257259 
    258 /* Error (path) */ 
     260/* WCWiredClientChecksumMismatch description (path) */ 
    259261"Could not resume transfer of \"%@\", the checksums do not match." = "Could not resume transfer of \"%@\", the checksums do not match."; 
    260262 
     
    265267"Could not start an upload, the checksums do not match." = "Could not start an upload, the checksums do not match."; 
    266268 
    267 /* Error */ 
     269/* WCWiredClientCreateFailed title */ 
    268270"Create Failed" = "Create Failed"; 
    269271 
     
    318320"file" = "file"; 
    319321 
    320 /* Error 
     322/* WCWiredClientFileExists title 
    321323   Transfers overwrite alert title */ 
    322324"File Exists" = "File Exists"; 
     
    340342"Finished %lu files, %@, average %@/s, took %@" = "Finished %1$lu files, %2$@, average %3$@/s, took %4$@"; 
    341343 
    342 /* Error */ 
     344/* WCWiredClientFolderExists title */ 
    343345"Folder Exists" = "Folder Exists"; 
    344346 
     
    462464"OK" = "OK"; 
    463465 
    464 /* Error */ 
     466/* WCWiredClientOpenFailed title */ 
    465467"Open Failed" = "Open Failed"; 
    466468 
     
    603605"The command could not be completed due to insufficient privileges." = "The command could not be completed due to insufficient privileges."; 
    604606 
    605 /* Error (path) */ 
     607/* WCWiredClientFileExists description (path) */ 
    606608"The file \"%@\" already exists." = "The file \"%@\" already exists."; 
    607609 
     
    609611"The file \"%@\" already exists. Overwrite?" = "The file \"%@\" already exists. Overwrite?"; 
    610612 
    611 /* Error (path) */ 
     613/* WCWiredClientTransferWithResourceFork description (path) */ 
    612614"The file \"%@\" has a resource fork, which is not handled by Wired. Only the data part will be uploaded, possibly resulting in a corrupted file. Please use an archiver to ensure the file will be uploaded correctly." = "The file \"%@\" has a resource fork, which is not handled by Wired. Only the data part will be uploaded, possibly resulting in a corrupted file. Please use an archiver to ensure the file will be uploaded correctly."; 
    613615 
    614 /* Error (path) */ 
     616/* WCWiredClientFolderExists description (path) */ 
    615617"The folder \"%@\" already exists." = "The folder \"%@\" already exists."; 
    616618 
    617 /* Error (number) */ 
     619/* WCWiredClientTransferWithResourceFork description (number) */ 
    618620"The folder contains %lu files with resource forks, which are not handled by Wired. Only the data parts will be uploaded, possibly resulting in corrupted files. Please use an archiver to ensure the files will be uploaded correctly." = "The folder contains %lu files with resource forks, which are not handled by Wired. Only the data parts will be uploaded, possibly resulting in corrupted files. Please use an archiver to ensure the files will be uploaded correctly."; 
    619621 
     
    633635"The server has unexpectedly disconnected." = "The server has unexpectedly disconnected."; 
    634636 
    635 /* Error (name) */ 
     637/* WCWiredClientTransferFailed description (name) */ 
    636638"The transfer of \"%@\" failed." = "The transfer of \"%@\" failed."; 
    637639 
     
    664666"Trackers" = "Trackers"; 
    665667 
    666 /* Error */ 
     668/* WCWiredClientTransferExists title */ 
    667669"Transfer Exists" = "Transfer Exists"; 
    668670 
    669 /* Error */ 
     671/* WCWiredClientTransferFailed title */ 
    670672"Transfer Failed" = "Transfer Failed"; 
    671673 
     
    676678"Transfer Finished" = "Transfer Finished"; 
    677679 
    678 /* Error */ 
     680/* WCWiredClientTransferWithResourceFork title */ 
    679681"Transfer Not Supported" = "Transfer Not Supported"; 
    680682 
     
    749751"Yes" = "Yes"; 
    750752 
    751 /* Error (path) */ 
     753/* WCWiredClientTransferExists description (path) */ 
    752754"You are already transferring \"%@\"." = "You are already transferring \"%@\"."; 
    753755 
  • WiredClient/trunk/WCError.h

    r4980 r5545  
    3838        WCWiredClientTransferWithResourceFork, 
    3939        WCWiredClientTransferFailed, 
    40         WCWiredClientChecksumMismatch 
     40        WCWiredClientChecksumMismatch, 
     41        WCWiredClientClientNotFound 
    4142}; 
    4243 
  • WiredClient/trunk/WCError.m

    r4799 r5545  
    4141                                 
    4242                        case WCWiredClientOpenFailed: 
    43                                 return NSLS(@"Open Failed", @"Error"); 
     43                                return NSLS(@"Open Failed", @"WCWiredClientOpenFailed title"); 
    4444                                break; 
    4545                                 
    4646                        case WCWiredClientCreateFailed: 
    47                                 return NSLS(@"Create Failed", @"Error"); 
     47                                return NSLS(@"Create Failed", @"WCWiredClientCreateFailed title"); 
    4848                                break; 
    4949                                 
    5050                        case WCWiredClientFileExists: 
    51                                 return NSLS(@"File Exists", @"Error"); 
     51                                return NSLS(@"File Exists", @"WCWiredClientFileExists title"); 
    5252                                break; 
    5353                                 
    5454                        case WCWiredClientFolderExists: 
    55                                 return NSLS(@"Folder Exists", @"Error"); 
     55                                return NSLS(@"Folder Exists", @"WCWiredClientFolderExists title"); 
    5656                                break; 
    5757                                 
    5858                        case WCWiredClientChecksumMismatch: 
    59                                 return NSLS(@"Checksum Mismatch", @"Error"); 
     59                                return NSLS(@"Checksum Mismatch", @"WCWiredClientChecksumMismatch title"); 
     60                                break; 
     61                                 
     62                        case WCWiredClientClientNotFound: 
     63                                return NSLS(@"Client Not Found", @"WCWiredClientClientNotFound title"); 
    6064                                break; 
    6165                                 
    6266                        case WCWiredClientTransferExists: 
    63                                 return NSLS(@"Transfer Exists", @"Error"); 
     67                                return NSLS(@"Transfer Exists", @"WCWiredClientTransferExists title"); 
    6468                                break; 
    6569                                 
    6670                        case WCWiredClientTransferWithResourceFork: 
    67                                 return NSLS(@"Transfer Not Supported", @"Error"); 
     71                                return NSLS(@"Transfer Not Supported", @"WCWiredClientTransferWithResourceFork title"); 
    6872                                break; 
    6973                                 
    7074                        case WCWiredClientTransferFailed: 
    71                                 return NSLS(@"Transfer Failed", @"Error"); 
     75                                return NSLS(@"Transfer Failed", @"WCWiredClientTransferFailed title"); 
    7276                                break; 
    7377                                 
     
    165169 
    166170                        case WCWiredClientOpenFailed: 
    167                                 return [NSSWF:NSLS(@"Could not open the file \"%@\".", @"Error (path)"), 
     171                                return [NSSWF:NSLS(@"Could not open the file \"%@\".", @"WCWiredClientOpenFailed description (path)"), 
    168172                                        argument]; 
    169173                                break; 
    170174                                 
    171175                        case WCWiredClientCreateFailed: 
    172                                 return [NSSWF:NSLS(@"Could not create the file \"%@\".", @"Error (path)"), 
     176                                return [NSSWF:NSLS(@"Could not create the file \"%@\".", @"WCWiredClientCreateFailed description (path)"), 
    173177                                        argument]; 
    174178                                break; 
    175179                                 
    176180                        case WCWiredClientFileExists: 
    177                                 return [NSSWF:NSLS(@"The file \"%@\" already exists.", @"Error (path)"), 
     181                                return [NSSWF:NSLS(@"The file \"%@\" already exists.", @"WCWiredClientFileExists description (path)"), 
    178182                                        argument]; 
    179183                                break; 
    180184                                 
    181185                        case WCWiredClientFolderExists: 
    182                                 return [NSSWF:NSLS(@"The folder \"%@\" already exists.", @"Error (path)"), 
     186                                return [NSSWF:NSLS(@"The folder \"%@\" already exists.", @"WCWiredClientFolderExists description (path)"), 
    183187                                        argument]; 
    184188                                break; 
    185189                                 
    186190                        case WCWiredClientChecksumMismatch: 
    187                                 return [NSSWF:NSLS(@"Could not resume transfer of \"%@\", the checksums do not match.", @"Error (path)"), 
    188                                         argument]; 
    189                                 break; 
    190                                  
     191                                return [NSSWF:NSLS(@"Could not resume transfer of \"%@\", the checksums do not match.", @"WCWiredClientChecksumMismatch description (path)"), 
     192                                        argument]; 
     193                                break; 
     194                                 
     195                        case WCWiredClientClientNotFound: 
     196                                return NSLS(@"Could not find the client you referred to. Perhaps that client left before the command could be completed.", @"WCWiredClientClientNotFound description"); 
     197                                break; 
     198 
    191199                        case WCWiredClientTransferExists: 
    192                                 return [NSSWF:NSLS(@"You are already transferring \"%@\".", @"Error (path)"), 
     200                                return [NSSWF:NSLS(@"You are already transferring \"%@\".", @"WCWiredClientTransferExists description (path)"), 
    193201                                        argument]; 
    194202                                break; 
     
    196204                        case WCWiredClientTransferWithResourceFork: 
    197205                                if([argument isKindOfClass:[NSString class]]) { 
    198                                         return [NSSWF:NSLS(@"The file \"%@\" has a resource fork, which is not handled by Wired. Only the data part will be uploaded, possibly resulting in a corrupted file. Please use an archiver to ensure the file will be uploaded correctly.", @"Error (path)"), 
     206                                        return [NSSWF:NSLS(@"The file \"%@\" has a resource fork, which is not handled by Wired. Only the data part will be uploaded, possibly resulting in a corrupted file. Please use an archiver to ensure the file will be uploaded correctly.", @"WCWiredClientTransferWithResourceFork description (path)"), 
    199207                                                argument]; 
    200208                                } 
    201209                                else if([argument isKindOfClass:[NSNumber class]]) { 
    202                                         return [NSSWF:NSLS(@"The folder contains %lu files with resource forks, which are not handled by Wired. Only the data parts will be uploaded, possibly resulting in corrupted files. Please use an archiver to ensure the files will be uploaded correctly.", @"Error (number)"), 
     210                                        return [NSSWF:NSLS(@"The folder contains %lu files with resource forks, which are not handled by Wired. Only the data parts will be uploaded, possibly resulting in corrupted files. Please use an archiver to ensure the files will be uploaded correctly.", @"WCWiredClientTransferWithResourceFork description (number)"), 
    203211                                                [argument unsignedIntegerValue]]; 
    204212                                } 
     
    206214 
    207215                        case WCWiredClientTransferFailed: 
    208                                 return [NSSWF:NSLS(@"The transfer of \"%@\" failed.", @"Error (name)"), 
     216                                return [NSSWF:NSLS(@"The transfer of \"%@\" failed.", @"WCWiredClientTransferFailed description (name)"), 
    209217                                        argument]; 
    210218                                break; 
  • WiredClient/trunk/WCMessages.m

    r5249 r5545  
    908908        WCMessage   *message; 
    909909        WCUser          *user; 
     910        WCError         *error; 
    910911         
    911912        message = [self _selectedMessage]; 
     
    916917        user = [[[self connection] chat] userWithUserID:[message userID]]; 
    917918         
    918         if(user) 
     919        if(user) { 
    919920                [self showPrivateMessageToUser:user]; 
     921        } else { 
     922                error = [WCError errorWithDomain:WCWiredClientErrorDomain code:WCWiredClientClientNotFound]; 
     923                [[self connection] triggerEvent:WCEventsError info1:error]; 
     924                [[error alert] beginSheetModalForWindow:[self window]]; 
     925        } 
    920926} 
    921927