Changeset 3711

Show
Ignore:
Timestamp:
08/15/07 02:32:06 (1 year ago)
Author:
timothy
Message:

Fix a crash on launch caused by [3710].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Frameworks/Acid/jabber/JabberSubscriptionRequest.m

    r3710 r3711  
    2626#import "acid.h" 
    2727 
    28 XPathQuery* QRY_MESSAGE; 
    29 NSDictionary* PRESSUBTYPE; 
    30  
    3128NSString* JXML_SUB_REQUEST = @"/presence[@type='subscribe']";        // subscribe 
    3229NSString* JXML_SUB_GRANTED = @"/presence[@type='subscribed']";        // subscribed 
     
    5249} 
    5350 
    54 +(void) initialize 
    55 { 
    56     QRY_MESSAGE = [[XPathQuery alloc] initWithPath:@"/presence/status"]; 
    57     PRESSUBTYPE = [[NSDictionary alloc] initWithObjectsAndKeys: 
    58                    [NSNumber numberWithLong:JSUBSCRIBE], @"subscribe", 
    59                    [NSNumber numberWithLong:JSUBSCRIBED], "@subscribed", 
    60                    [NSNumber numberWithLong:JUNSUBSCRIBE], "@unsubscribed", 
    61                    [NSNumber numberWithLong:JUNSUBSCRIBED], "@unsubscribed", nil]; 
    62 } 
    63  
    6451-(id) initWithRecipient:(JabberID*)jid 
    6552{ 
     
    7966-(void) resync 
    8067{ 
     68    static XPathQuery *QRY_MESSAGE = nil; 
     69    static NSDictionary *PRESSUBTYPE = nil; 
     70 
     71    if(!QRY_MESSAGE) 
     72        QRY_MESSAGE = [[XPathQuery alloc] initWithPath:@"/presence/status"]; 
     73 
     74    if(!PRESSUBTYPE) { 
     75        PRESSUBTYPE = [[NSDictionary alloc] initWithObjectsAndKeys: 
     76            [NSNumber numberWithLong:JSUBSCRIBE], @"subscribe", 
     77            [NSNumber numberWithLong:JSUBSCRIBED], @"subscribed", 
     78            [NSNumber numberWithLong:JUNSUBSCRIBE], @"unsubscribed", 
     79            [NSNumber numberWithLong:JUNSUBSCRIBED], @"unsubscribed", nil]; 
     80    } 
     81 
    8182    [_to release]; 
    8283    _to      = [[JabberID alloc] initWithString:[self getAttribute:@"to"]];