Adium

Ticket #344: KielBlocking.patch

File KielBlocking.patch, 38.9 kB (added by Kiel Gillard, 3 years ago)

cbarrett's tamed svk version of my patch...

  • Frameworks/Adium

    old new  
    4444- (void)setOnline:(BOOL)online notify:(NotifyTiming)notify silently:(BOOL)silent; 
    4545- (void)setSignonDate:(NSDate *)signonDate notify:(NotifyTiming)notify; 
    4646- (NSDate *)signonDate; 
     47- (void)setIsBlocked:(BOOL)yesOrNo; 
    4748 
    4849- (void)setIdle:(BOOL)isIdle sinceDate:(NSDate *)idleSinceDate notify:(NotifyTiming)notify; 
    4950- (void)setServersideIconData:(NSData *)iconData notify:(NotifyTiming)notify; 
  • Frameworks/Adium

    old new  
    2828#import <AIUtilities/AIMutableOwnerArray.h> 
    2929#import <AIUtilities/AIMutableStringAdditions.h> 
    3030 
     31#define IS_BLOCKED_KEY @"isBlocked" 
     32 
    3133@implementation AIListContact 
    3234 
    3335//Init with an account 
     
    456458                                   notify:notify]; 
    457459} 
    458460 
     461/*! 
     462 * @brief Is this contact blocked? 
     463 */ 
     464- (BOOL)isBlocked 
     465{ 
     466        return [self integerStatusObjectForKey:IS_BLOCKED_KEY]; 
     467} 
     468 
     469/*! 
     470 * @brief Set if this contact is blocked 
     471 */ 
     472- (void)setIsBlocked:(BOOL)yesOrNo 
     473{ 
     474        [self setStatusObject:(yesOrNo ? [NSNumber numberWithBool:YES] : nil) 
     475                                   forKey:IS_BLOCKED_KEY  
     476                                   notify:NotifyNow]; 
     477} 
     478 
    459479#pragma mark Status 
    460480 
    461481/*! 
  • Frameworks/Adium

    old new  
    3131#define KEY_LIST_LAYOUT_SHOW_EXT_STATUS                 @"Show Extended Status" 
    3232#define KEY_LIST_LAYOUT_SHOW_STATUS_ICONS               @"Show Status Icons" 
    3333#define KEY_LIST_LAYOUT_SHOW_SERVICE_ICONS              @"Show Service Icons" 
     34#define KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS              @"Show Blocked Icons" 
    3435#define KEY_LIST_LAYOUT_WINDOW_STYLE                    @"Window Style" 
    3536 
    3637#define KEY_LIST_LAYOUT_EXTENDED_STATUS_STYLE   @"Extended Status Style" 
     
    3839#define KEY_LIST_LAYOUT_USER_ICON_POSITION              @"User Icon Position" 
    3940#define KEY_LIST_LAYOUT_STATUS_ICON_POSITION    @"Status Icon Position" 
    4041#define KEY_LIST_LAYOUT_SERVICE_ICON_POSITION   @"Service Icon Position" 
     42#define KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION   @"Blocked Icon Position" 
    4143 
    4244#define KEY_LIST_LAYOUT_CONTACT_SPACING                 @"Contact Spacing" 
    4345#define KEY_LIST_LAYOUT_GROUP_TOP_SPACING               @"Group Top Spacing" 
  • Frameworks/Adium

    old new  
    249249                [contentCell setExtendedStatusVisible:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_EXT_STATUS] boolValue]]; 
    250250                [contentCell setStatusIconsVisible:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_STATUS_ICONS] boolValue]]; 
    251251                [contentCell setServiceIconsVisible:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_SERVICE_ICONS] boolValue]]; 
     252                [contentCell setBlockedIconVisible:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS] boolValue]]; 
    252253 
    253254                [contentCell setUserIconPosition:[[prefDict objectForKey:KEY_LIST_LAYOUT_USER_ICON_POSITION] intValue]]; 
    254255                [contentCell setStatusIconPosition:[[prefDict objectForKey:KEY_LIST_LAYOUT_STATUS_ICON_POSITION] intValue]]; 
    255256                [contentCell setServiceIconPosition:[[prefDict objectForKey:KEY_LIST_LAYOUT_SERVICE_ICON_POSITION] intValue]]; 
     257                [contentCell setBlockedIconPosition:[[prefDict objectForKey:KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION] intValue]]; 
    256258                [contentCell setExtendedStatusIsBelowName:[[prefDict objectForKey:KEY_LIST_LAYOUT_EXTENDED_STATUS_POSITION] boolValue]];                 
    257259        } else { 
    258260                //Fitted pillows + centered text = no icons 
     
    261263                [contentCell setUserIconVisible:(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_ICON] boolValue] : NO)]; 
    262264                [contentCell setStatusIconsVisible:(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_STATUS_ICONS] boolValue] : NO)]; 
    263265                [contentCell setServiceIconsVisible:(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_SERVICE_ICONS] boolValue] : NO)]; 
     266                [contentCell setBlockedIconVisible:(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS] boolValue] : NO)]; 
    264267 
    265268                [contentCell setExtendedStatusVisible:NO /*(allowIcons ? [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_EXT_STATUS] boolValue] : NO)*/]; 
    266269 
     
    282285                                                                                                         contentCellAlignment:contentCellAlignment]; 
    283286                        [contentCell setServiceIconPosition:iconPosition]; 
    284287                         
     288                        iconPosition = [[prefDict objectForKey:KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION] intValue]; 
     289                        iconPosition = [self pillowsFittedIconPositionForIconPosition:iconPosition 
     290                                                                                                         contentCellAlignment:contentCellAlignment]; 
     291                        [contentCell setBlockedIconPosition:iconPosition]; 
     292                         
    285293                        //Force extended status below the name (?) 
    286294                        [contentCell setExtendedStatusIsBelowName:YES]; 
    287295                } 
  • Frameworks/Adium

    old new  
    3131#define SERVICE_ICON_LEFT_PAD           2 
    3232#define SERVICE_ICON_RIGHT_PAD          2 
    3333 
     34//Blocked icon 
     35#define BLOCKED_ICON_LEFT_PAD           2 
     36#define BLOCKED_ICON_RIGHT_PAD          2 
     37 
    3438@interface AIListContactCell : AIListCell { 
    3539        BOOL                            userIconVisible; 
    3640        BOOL                            extendedStatusVisible; 
    3741        BOOL                            statusIconsVisible; 
    3842        BOOL                            serviceIconsVisible; 
     43        BOOL                            blockedIconVisible; 
    3944        NSSize                          userIconSize; 
    4045        int                                     statusFontHeight;        
    4146         
     
    4651        LIST_POSITION           userIconPosition; 
    4752        LIST_POSITION           statusIconPosition; 
    4853        LIST_POSITION           serviceIconPosition; 
     54        LIST_POSITION           blockedIconPosition; 
    4955        BOOL                            extendedStatusIsBelowName; 
    5056         
    5157        float                           backgroundOpacity; 
     
    7783- (BOOL)statusIconsVisible; 
    7884- (void)setServiceIconsVisible:(BOOL)inShowService; 
    7985- (BOOL)serviceIconsVisible; 
     86- (void)setBlockedIconVisible:(BOOL)yesOrNo; 
     87- (BOOL)blockedIconVisible; 
    8088- (void)setExtendedStatusIsBelowName:(BOOL)inBelowName; 
    8189- (void)setUserIconPosition:(LIST_POSITION)inPosition; 
    8290- (void)setStatusIconPosition:(LIST_POSITION)inPosition; 
    8391- (void)setServiceIconPosition:(LIST_POSITION)inPosition; 
     92- (void)setBlockedIconPosition:(LIST_POSITION)inPosition; 
    8493- (void)setBackgroundOpacity:(float)inOpacity; 
    8594- (float)backgroundOpacity; 
    8695- (void)setBackgroundColorIsStatus:(BOOL)isStatus; 
     
    93102- (NSRect)drawUserIconInRect:(NSRect)inRect position:(IMAGE_POSITION)position; 
    94103- (NSRect)drawStatusIconInRect:(NSRect)rect position:(IMAGE_POSITION)position; 
    95104- (NSRect)drawServiceIconInRect:(NSRect)rect position:(IMAGE_POSITION)position; 
     105- (NSRect)drawBlockedIconInRect:(NSRect)rect position:(IMAGE_POSITION)position; 
    96106- (NSRect)drawUserExtendedStatusInRect:(NSRect)rect drawUnder:(BOOL)drawUnder; 
    97107- (NSColor *)labelColor; 
    98108- (NSColor *)textColor; 
    99109- (NSImage *)userIconImage; 
    100110- (NSImage *)statusImage; 
    101111- (NSImage *)serviceImage; 
     112- (NSImage *)blockedImage; 
    102113//- (BOOL)drawStatusBelowLabelInRect:(NSRect)rect; 
    103114- (BOOL)drawGridBehindCell; 
    104115- (float)imageOpacityForDrawing; 
  • Frameworks/Adium

    old new  
    1717#import "AIListContactCell.h" 
    1818#import "AIListLayoutWindowController.h" 
    1919#import "AIListObject.h" 
     20#import "AIListContact.h" 
    2021#import <AIUtilities/AIAttributedStringAdditions.h> 
    2122#import <AIUtilities/AIParagraphStyleAdditions.h> 
     23#import <Adium/AIStatusIcons.h> 
    2224#import <Adium/AIServiceIcons.h> 
    2325#import <Adium/AIUserIcons.h> 
    2426 
     
    135137                width += SERVICE_ICON_LEFT_PAD + SERVICE_ICON_RIGHT_PAD; 
    136138        } 
    137139         
     140        //Blocked icon 
     141        if (blockedIconVisible && 
     142                (blockedIconPosition != LIST_POSITION_BADGE_LEFT && blockedIconPosition != LIST_POSITION_BADGE_RIGHT)) { 
     143                width += [[self blockedImage] size].width; 
     144                width += BLOCKED_ICON_LEFT_PAD + BLOCKED_ICON_RIGHT_PAD; 
     145        } 
     146         
    138147        return width + 1; 
    139148} 
    140149 
     
    270279        return serviceIconsVisible; 
    271280} 
    272281 
     282/*! 
     283 * @brief Set if a blocked icon be shown for a blocked contact 
     284 */ 
     285- (void)setBlockedIconVisible:(BOOL)yesOrNo 
     286{ 
     287        blockedIconVisible = yesOrNo; 
     288} 
     289 
     290/*! 
     291 * @brief Should a block icon for a blocked contact be shown? 
     292 */ 
     293- (BOOL)blockedIconVisible 
     294{ 
     295        return blockedIconVisible; 
     296} 
     297 
    273298//Element Positioning 
    274299- (void)setExtendedStatusIsBelowName:(BOOL)inBelowName{ 
    275300        extendedStatusIsBelowName = inBelowName; 
     
    284309        serviceIconPosition = inPosition; 
    285310} 
    286311 
     312/*! 
     313 * @brief Remember where a blocked icon should be drawn.  
     314 */ 
     315- (void)setBlockedIconPosition:(LIST_POSITION)inPosition 
     316{ 
     317        blockedIconPosition = inPosition; 
     318} 
     319 
    287320//Opacity 
    288321- (void)setBackgroundOpacity:(float)inOpacity 
    289322{ 
     
    320353        //Far Left 
    321354        if (statusIconPosition == LIST_POSITION_FAR_LEFT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_LEFT]; 
    322355        if (serviceIconPosition == LIST_POSITION_FAR_LEFT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_LEFT]; 
     356        if (blockedIconPosition == LIST_POSITION_FAR_LEFT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_LEFT]; 
    323357         
    324358        //User Icon [Left] 
    325359        if (userIconPosition == LIST_POSITION_LEFT) rect = [self drawUserIconInRect:rect position:IMAGE_POSITION_LEFT]; 
     
    327361        //Left 
    328362        if (statusIconPosition == LIST_POSITION_LEFT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_LEFT]; 
    329363        if (serviceIconPosition == LIST_POSITION_LEFT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_LEFT]; 
     364        if (blockedIconPosition == LIST_POSITION_LEFT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_LEFT]; 
     365 
    330366         
    331367        //Far Right 
    332368        if (statusIconPosition == LIST_POSITION_FAR_RIGHT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_RIGHT]; 
    333369        if (serviceIconPosition == LIST_POSITION_FAR_RIGHT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_RIGHT]; 
     370        if (blockedIconPosition == LIST_POSITION_FAR_RIGHT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_RIGHT]; 
    334371         
    335372        //User Icon [Right] 
    336373        if (userIconPosition == LIST_POSITION_RIGHT) rect = [self drawUserIconInRect:rect position:IMAGE_POSITION_RIGHT]; 
     
    338375        //Right 
    339376        if (statusIconPosition == LIST_POSITION_RIGHT) rect = [self drawStatusIconInRect:rect position:IMAGE_POSITION_RIGHT]; 
    340377        if (serviceIconPosition == LIST_POSITION_RIGHT) rect = [self drawServiceIconInRect:rect position:IMAGE_POSITION_RIGHT]; 
     378        if (blockedIconPosition == LIST_POSITION_RIGHT) rect = [self drawBlockedIconInRect:rect position:IMAGE_POSITION_RIGHT]; 
    341379         
    342380        //Extended Status 
    343381        if (extendedStatusIsBelowName) rect = [self drawUserExtendedStatusInRect:rect drawUnder:YES]; 
     
    392430                        [self drawServiceIconInRect:drawRect position:IMAGE_POSITION_LOWER_RIGHT]; 
    393431                } 
    394432                 
     433                //badge the user icon with the status pack's blocked icon 
     434                if (blockedIconPosition == LIST_POSITION_BADGE_LEFT) { 
     435                        [self drawBlockedIconInRect:drawRect position:IMAGE_POSITION_LOWER_LEFT]; 
     436                } else if (blockedIconPosition == LIST_POSITION_BADGE_RIGHT) { 
     437                        [self drawBlockedIconInRect:drawRect position:IMAGE_POSITION_LOWER_RIGHT]; 
     438                } 
     439                 
    395440                //If we're using space on the right, shrink the width so we won't be overlapped 
    396441//              if (position == IMAGE_POSITION_RIGHT) rect.size.width -= USER_ICON_RIGHT_PAD; 
    397442                if (position == IMAGE_POSITION_LEFT) rect.origin.x += USER_ICON_RIGHT_PAD; 
     
    459504        return rect; 
    460505} 
    461506 
     507/*! 
     508 * @brief Draw the Blocked icon in the contact's rect 
     509 */ 
     510- (NSRect)drawBlockedIconInRect:(NSRect)rect position:(IMAGE_POSITION)position 
     511{ 
     512         
     513        if ([self blockedIconVisible] && [(AIListContact *)listObject isBlocked]) { 
     514                BOOL    isBadge = (position == IMAGE_POSITION_LOWER_LEFT || position == IMAGE_POSITION_LOWER_RIGHT); 
     515 
     516                if (!isBadge) { 
     517                        if (position == IMAGE_POSITION_LEFT) rect.origin.x += BLOCKED_ICON_LEFT_PAD; 
     518                        rect.size.width -= BLOCKED_ICON_LEFT_PAD; 
     519                } 
     520                 
     521                /* 
     522                 Draw the blocked icon if (it is not a badge), or if (it is a badge and there is a userIconImage) 
     523                 (We have already drawn the blocked icon if there is no userIconImage, in drawUserIconInRect:position:) 
     524                 */ 
     525                if (!isBadge || ([self userIconImage] != nil)) { 
     526                        NSImage *image = [self blockedImage]; 
     527                        [image setFlipped:![image isFlipped]]; 
     528                        rect = [image drawInRect:rect 
     529                                                          atSize:NSMakeSize(0, 0) 
     530                                                        position:position 
     531                                                        fraction:1.0]; 
     532                        [image setFlipped:![image isFlipped]]; 
     533                } 
     534                 
     535                if (!isBadge) { 
     536                        if (position == IMAGE_POSITION_LEFT) rect.origin.x += BLOCKED_ICON_RIGHT_PAD; 
     537                        rect.size.width -= BLOCKED_ICON_RIGHT_PAD; 
     538                } 
     539        } 
     540        return rect; 
     541} 
     542 
    462543//User Extended Status 
    463544- (NSRect)drawUserExtendedStatusInRect:(NSRect)rect drawUnder:(BOOL)drawUnder 
    464545{ 
     
    582663        return [AIServiceIcons serviceIconForObject:listObject type:AIServiceIconList direction:AIIconFlipped]; 
    583664} 
    584665 
     666/*! 
     667 * @brief Return blocked icon image from current status pack 
     668 */ 
     669- (NSImage *)blockedImage 
     670{ 
     671        return [AIStatusIcons statusIconForStatusName:@"Blocked"  
     672                                                                           statusType:AIAwayStatus  
     673                                                                                 iconType:AIStatusIconList 
     674                                                                                direction:AIIconNormal]; 
     675} 
     676 
    585677//No need to the grid if we have a status color to draw 
    586678- (BOOL)drawGridBehindCell 
    587679{ 
  • Frameworks/Adium

    old new  
    119119 
    120120- (BOOL)isStranger; 
    121121- (BOOL)isMobile; 
     122- (BOOL)isBlocked; 
    122123 
    123124- (NSString *)displayName; 
    124125- (void)setDisplayName:(NSString *)alias; 
  • Frameworks/Adium

    old new  
    590590} 
    591591 
    592592/*! 
     593 * @brief Is this contact blocked? 
     594 */ 
     595- (BOOL)isBlocked 
     596{ 
     597        return NO; 
     598} 
     599 
     600/*! 
    593601 * @brief Set the current status message 
    594602 * 
    595603 * @param statusMessage Status message. May be nil. 
  • Frameworks/Adium

    old new  
    183183        return NO; 
    184184} 
    185185 
     186/*! 
     187 * @brief Are all the contacts in this meta blocked? 
     188 */ 
     189- (BOOL)isBlocked 
     190{ 
     191        BOOL                    allContactsBlocked = YES; 
     192        NSEnumerator    *enumerator = [self listContactsEnumerator]; 
     193        AIListContact   *currentContact = nil; 
     194         
     195        while ((currentContact = [enumerator nextObject])) { 
     196                if (![currentContact isBlocked]) { 
     197                        allContactsBlocked = NO; 
     198                        break; 
     199                } 
     200        } 
     201         
     202        return allContactsBlocked; 
     203} 
     204 
    186205//Object Storage ------------------------------------------------------------------------------------------------------- 
    187206#pragma mark Object Storage 
    188207/*! 
  • Source/ESBlockingPlugin.m

    old new  
    5656        [blockContactContextualMenuItem release]; 
    5757} 
    5858 
    59  
    6059- (IBAction)blockContact:(id)sender 
    6160{ 
    6261        AIListObject    *object; 
     
    7877 
    7978                if (NSRunAlertPanel([NSString stringWithFormat:format, [contact displayName]], 
    8079                                                   @"", 
    81                                                    AILocalizedString(@"OK", nil)
     80                                                   [sender title]
    8281                                                   AILocalizedString(@"Cancel", nil), 
    8382                                                   nil) == NSAlertDefaultReturn) { 
    8483                         
     
    198197                        AIAccount <AIAccount_Privacy> *privacyAccount = (AIAccount <AIAccount_Privacy> *)account; 
    199198                        if (unblock) { 
    200199                                if ([[privacyAccount listObjectIDsOnPrivacyList:PRIVACY_DENY] containsObject:[contact UID]]) { 
    201                                         [privacyAccount removeListObject:contact fromPrivacyList:PRIVACY_DENY]; 
     200                                        if ([privacyAccount removeListObject:contact fromPrivacyList:PRIVACY_DENY]) { 
     201                                                [contact setIsBlocked:NO]; 
     202                                        } 
    202203                                } 
    203204                        } else { 
    204205                                if (![[privacyAccount listObjectIDsOnPrivacyList:PRIVACY_DENY] containsObject:[contact UID]]) { 
    205                                         [privacyAccount addListObject:contact toPrivacyList:PRIVACY_DENY]; 
     206                                        if ([privacyAccount addListObject:contact toPrivacyList:PRIVACY_DENY]) { 
     207                                                [contact setIsBlocked:YES]; 
     208                                        } 
    206209                                } 
    207210                        } 
    208211                } 
  • Plugins/Contact

    old new  
    2626        IBOutlet                NSPopUpButton           *popUp_userIconPosition; 
    2727        IBOutlet                NSPopUpButton           *popUp_statusIconPosition; 
    2828        IBOutlet                NSPopUpButton           *popUp_serviceIconPosition; 
     29        IBOutlet                NSPopUpButton           *popUp_blockedIconPosition; 
    2930 
    3031        IBOutlet                NSButton                        *checkBox_userIconVisible; 
    3132        IBOutlet                NSButton                        *checkBox_extendedStatusVisible; 
    3233        IBOutlet                NSButton                        *checkBox_statusIconsVisible; 
    3334        IBOutlet                NSButton                        *checkBox_serviceIconsVisible; 
     35        IBOutlet                NSButton                        *checkBox_blockedIconsVisible; 
    3436 
    3537        IBOutlet                NSSlider                        *slider_userIconSize; 
    3638        IBOutlet                NSTextField                     *textField_userIconSize; 
  • Plugins/Contact

    old new  
    3535- (void)configureControlDimming; 
    3636- (void)updateSliderValues; 
    3737- (void)updateDisplayedTabsFromPrefDict:(NSDictionary *)prefDict; 
    38 - (void)updateStatusAndServiceIconMenusFromPrefDict:(NSDictionary *)prefDict; 
     38- (void)updateMenusOfBadgeableIconsFromPrefDict:(NSDictionary *)prefDict; 
    3939- (void)updateUserIconMenuFromPrefDict:(NSDictionary *)prefDict; 
     40- (void)updateBlockedIconMenuFromPrefDict:(NSDictionary *)prefDict; 
    4041- (NSMenu *)alignmentMenuWithChoices:(int [])alignmentChoices; 
    4142- (NSMenu *)positionMenuWithChoices:(int [])positionChoices; 
    4243- (NSMenu *)extendedStatusStyleMenu; 
     
    144145        textAlignmentChoices[3] = -1; 
    145146         
    146147        [self updateDisplayedTabsFromPrefDict:prefDict]; 
    147          
    148         [self updateStatusAndServiceIconMenusFromPrefDict:prefDict]; 
    149          
     148        [self updateMenusOfBadgeableIconsFromPrefDict:prefDict]; 
    150149        [self updateUserIconMenuFromPrefDict:prefDict]; 
    151150         
    152151        //Context text alignment 
     
    189188                NSDictionary    *prefDict; 
    190189                prefDict = [[adium preferenceController] preferencesForGroup:PREF_GROUP_LIST_LAYOUT]; 
    191190                 
    192                 [self updateStatusAndServiceIconMenusFromPrefDict:prefDict]; 
     191                [self updateMenusOfBadgeableIconsFromPrefDict:prefDict]; 
    193192                [self updateUserIconMenuFromPrefDict:prefDict]; 
    194193                 
    195194                [self configureControlDimming]; 
     
    219218                                                                                         forKey:KEY_LIST_LAYOUT_SERVICE_ICON_POSITION 
    220219                                                                                          group:PREF_GROUP_LIST_LAYOUT]; 
    221220                 
     221        } else if (sender == popUp_blockedIconPosition) { 
     222                [[adium preferenceController] setPreference:[NSNumber numberWithInt:[[sender selectedItem] tag]] 
     223                                                                                         forKey:KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION 
     224                                                                                          group:PREF_GROUP_LIST_LAYOUT]; 
     225 
    222226        } else if (sender == popUp_extendedStatusStyle) { 
    223227                [[adium preferenceController] setPreference:[NSNumber numberWithInt:[[sender selectedItem] tag]] 
    224228                                                                                         forKey:KEY_LIST_LAYOUT_EXTENDED_STATUS_STYLE 
     
    250254                                                                                          group:PREF_GROUP_LIST_LAYOUT]; 
    251255                 
    252256                prefDict  = [[adium preferenceController] preferencesForGroup:PREF_GROUP_LIST_LAYOUT]; 
    253                 //Update the status and service icon menus to show/hide the badge options 
    254                 [self updateStatusAndServiceIconMenusFromPrefDict:prefDict]; 
     257                //Update the status, blocked and service icon menus to show/hide the badge options 
     258                [self updateMenusOfBadgeableIconsFromPrefDict:prefDict]; 
    255259                [self configureControlDimming]; 
    256260                 
    257261        } else if (sender == checkBox_extendedStatusVisible) { 
     
    272276                                                                                          group:PREF_GROUP_LIST_LAYOUT]; 
    273277                [self configureControlDimming]; 
    274278                 
     279    } else if (sender == checkBox_blockedIconsVisible) { 
     280                [[adium preferenceController] setPreference:[NSNumber numberWithBool:[sender state]] 
     281                                                                                         forKey:KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS 
     282                                                                                          group:PREF_GROUP_LIST_LAYOUT]; 
     283                [self configureControlDimming]; 
     284                 
    275285    } else if (sender == checkBox_outlineBubbles) { 
    276286        [[adium preferenceController] setPreference:[NSNumber numberWithBool:[sender state]] 
    277287                                             forKey:KEY_LIST_LAYOUT_OUTLINE_BUBBLE 
     
    383393                [checkBox_serviceIconsVisible setEnabled:YES]; 
    384394                [checkBox_serviceIconsVisible setState:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_SERVICE_ICONS] boolValue]];  
    385395                 
     396                [checkBox_blockedIconsVisible setEnabled:YES]; 
     397                [checkBox_blockedIconsVisible setState:[[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_BLOCKED_ICONS] boolValue]];  
     398                 
    386399        } else { 
    387400                //For fitted and centered, disable and set to NO 
    388401                [checkBox_userIconVisible setEnabled:NO]; 
     
    393406                 
    394407                [checkBox_serviceIconsVisible setEnabled:NO]; 
    395408                [checkBox_serviceIconsVisible setState:NO]; 
     409                 
     410                [checkBox_blockedIconsVisible setEnabled:NO]; 
     411                [checkBox_blockedIconsVisible setState:NO]; 
    396412        } 
    397413         
    398414         
     
    415431        [popUp_serviceIconPosition setEnabled:([checkBox_serviceIconsVisible state] && 
    416432                                                                                   [checkBox_serviceIconsVisible isEnabled] && 
    417433                                                                                   ([popUp_serviceIconPosition numberOfItems] > 0))]; 
     434        [popUp_blockedIconPosition setEnabled:([checkBox_blockedIconsVisible state] && 
     435                                                                                   [checkBox_blockedIconsVisible isEnabled] && 
     436                                                                                   ([popUp_blockedIconPosition numberOfItems] > 0))]; 
    418437        [popUp_userIconPosition setEnabled:([checkBox_userIconVisible state] && 
    419438                                                                                [checkBox_userIconVisible isEnabled] && 
    420439                                                                                ([popUp_userIconPosition numberOfItems] > 0))]; 
     
    429448        [slider_outlineWidth setEnabled:[checkBox_outlineBubbles state]]; 
    430449} 
    431450 
    432 - (void)updateStatusAndServiceIconMenusFromPrefDict:(NSDictionary *)prefDict 
     451/*! 
     452 * @brief Update menus of icons that are badgeable 
     453 */ 
     454- (void)updateMenusOfBadgeableIconsFromPrefDict:(NSDictionary *)prefDict 
    433455{ 
    434         int                             statusAndServicePositionChoices[7]; 
     456        int                             choices[7]; 
    435457        BOOL                    showUserIcon = [[prefDict objectForKey:KEY_LIST_LAYOUT_SHOW_ICON] boolValue]; 
    436458        int                             indexForFinishingChoices = 0; 
    437459         
    438460        if ([[[adium preferenceController] preferenceForKey:KEY_LIST_LAYOUT_WINDOW_STYLE group:PREF_GROUP_APPEARANCE] intValue] != WINDOW_STYLE_PILLOWS_FITTED) { 
    439                 statusAndServicePositionChoices[0] = LIST_POSITION_FAR_LEFT; 
    440                 statusAndServicePositionChoices[1] = LIST_POSITION_LEFT; 
    441                 statusAndServicePositionChoices[2] = LIST_POSITION_RIGHT; 
    442                 statusAndServicePositionChoices[3] = LIST_POSITION_FAR_RIGHT; 
     461                choices[0] = LIST_POSITION_FAR_LEFT; 
     462                choices[1] = LIST_POSITION_LEFT; 
     463                choices[2] = LIST_POSITION_RIGHT; 
     464                choices[3] = LIST_POSITION_FAR_RIGHT; 
    443465                 
    444466                indexForFinishingChoices = 4; 
    445467                 
     
    447469                //For fitted pillows, only show the options which correspond to the text alignment 
    448470                switch ([[prefDict objectForKey:KEY_LIST_LAYOUT_ALIGNMENT] intValue]) { 
    449471                        case NSLeftTextAlignment: 
    450                                 statusAndServicePositionChoices[0] = LIST_POSITION_FAR_LEFT; 
    451                                 statusAndServicePositionChoices[1] = LIST_POSITION_LEFT; 
     472                                choices[0] = LIST_POSITION_FAR_LEFT; 
     473                                choices[1] = LIST_POSITION_LEFT; 
    452474                                indexForFinishingChoices = 2; 
    453475                                break; 
    454476                                 
    455477                        case NSRightTextAlignment: 
    456                                 statusAndServicePositionChoices[0] = LIST_POSITION_RIGHT; 
    457                                 statusAndServicePositionChoices[1] = LIST_POSITION_FAR_RIGHT; 
     478                                choices[0] = LIST_POSITION_RIGHT; 
     479                                choices[1] = LIST_POSITION_FAR_RIGHT; 
    458480                                indexForFinishingChoices = 2; 
    459481                                 
    460482                                break; 
     
    466488         
    467489        //Only show the badge choices if we are showing the user icon 
    468490        if (showUserIcon && (indexForFinishingChoices != 0)) { 
    469                 statusAndServicePositionChoices[indexForFinishingChoices] = LIST_POSITION_BADGE_LEFT; 
    470                 statusAndServicePositionChoices[indexForFinishingChoices + 1] = LIST_POSITION_BADGE_RIGHT; 
    471                 statusAndServicePositionChoices[indexForFinishingChoices + 2] = -1; 
     491                choices[indexForFinishingChoices] = LIST_POSITION_BADGE_LEFT; 
     492                choices[indexForFinishingChoices + 1] = LIST_POSITION_BADGE_RIGHT; 
     493                choices[indexForFinishingChoices + 2] = -1; 
    472494                 
    473495        } else { 
    474                 statusAndServicePositionChoices[indexForFinishingChoices] = -1; 
     496                choices[indexForFinishingChoices] = -1; 
    475497                 
    476498        } 
    477499         
    478         [popUp_statusIconPosition setMenu:[self positionMenuWithChoices:statusAndServicePositionChoices]]; 
     500        //update status icon positions in menu 
     501        [popUp_statusIconPosition setMenu:[self positionMenuWithChoices:choices]]; 
    479502        [popUp_statusIconPosition compatibleSelectItemWithTag:[[prefDict objectForKey:KEY_LIST_LAYOUT_STATUS_ICON_POSITION] intValue]]; 
    480503         
    481         [popUp_serviceIconPosition setMenu:[self positionMenuWithChoices:statusAndServicePositionChoices]]; 
    482         [popUp_serviceIconPosition compatibleSelectItemWithTag:[[prefDict objectForKey:KEY_LIST_LAYOUT_SERVICE_ICON_POSITION] intValue]];        
     504        //update service icon positions in menu 
     505        [popUp_serviceIconPosition setMenu:[self positionMenuWithChoices:choices]]; 
     506        [popUp_serviceIconPosition compatibleSelectItemWithTag:[[prefDict objectForKey:KEY_LIST_LAYOUT_SERVICE_ICON_POSITION] intValue]]; 
     507         
     508        //update blocked icon positions in menu 
     509        [popUp_blockedIconPosition setMenu:[self positionMenuWithChoices:choices]]; 
     510        [popUp_blockedIconPosition compatibleSelectItemWithTag:[[prefDict objectForKey:KEY_LIST_LAYOUT_BLOCKED_ICON_POSITION] intValue]]; 
    483511} 
    484512 
    485513- (void)updateUserIconMenuFromPrefDict:(NSDictionary *)prefDict 
  • Plugins/Status

    old new  
    9797                //If any accounts are online, set our state to ONLINE. 
    9898                NSEnumerator *accountsEnumerator = [[[adium accountController] accounts] objectEnumerator]; 
    9999                AIAccount *account = nil; 
    100                 while (account = [enumerator nextObject]) { 
     100                while (account = [accountsEnumerator nextObject]) { 
    101101                        if ([account statusForKey:@"Online"]) { 
    102102                                [self setIconState:ONLINE]; 
    103103                        } 
  • Plugins/Gaim

    old new  
    10431043                AIListContact   *contact = [self contactWithUID:sourceUID]; 
    10441044                 
    10451045                [(type == PRIVACY_PERMIT ? permittedContactsArray : deniedContactsArray) addObject:contact]; 
     1046                [contact setIsBlocked:(type == PRIVACY_DENY)]; 
    10461047        } 
    10471048} 
    10481049 
  • Resources/Status

    old new  
    2020                <string>offline.png</string> 
    2121                <key>Unknown</key> 
    2222                <string>unknown.png</string> 
     23                <key>Blocked</key> 
     24                <string>blocked.png</string> 
    2325                <key>content</key> 
    2426                <string>content.png</string> 
    2527                <key>enteredtext</key>