Don't allow a user to try and follow themselves. Fixes #12092.
authorZachary West <zacw@adium.im>
Sun Nov 22 23:45:20 2009 -0500 (2009-11-22)
changeset 27967ffe6bd0f0d7
parent 2795 ffdf2878fc68
child 2797 0423824a16e0
Don't allow a user to try and follow themselves. Fixes #12092.
Plugins/Twitter Plugin/AITwitterAccount.m
     1.1 --- a/Plugins/Twitter Plugin/AITwitterAccount.m	Sun Nov 22 23:26:55 2009 -0500
     1.2 +++ b/Plugins/Twitter Plugin/AITwitterAccount.m	Sun Nov 22 23:45:20 2009 -0500
     1.3 @@ -31,6 +31,7 @@
     1.4  #import <Adium/AIAccountControllerProtocol.h>
     1.5  #import <Adium/AIContactObserverManager.h>
     1.6  #import <Adium/AIListContact.h>
     1.7 +#import <Adium/AIListGroup.h>
     1.8  #import <Adium/AIContentMessage.h>
     1.9  #import <Adium/AIListBookmark.h>
    1.10  #import <Adium/AIChat.h>
    1.11 @@ -911,6 +912,11 @@
    1.12   */
    1.13  - (void)addContact:(AIListContact *)contact toGroup:(AIListGroup *)group
    1.14  {
    1.15 +	if ([contact.UID isCaseInsensitivelyEqualToString:self.UID]) {
    1.16 +		AILogWithSignature(@"Not adding contact %@ to group %@, it's me!", contact.UID, group.UID);
    1.17 +		return;
    1.18 +	}
    1.19 +	
    1.20  	NSString	*requestID = [twitterEngine enableUpdatesFor:contact.UID];
    1.21  	
    1.22  	AILogWithSignature(@"%@ Requesting follow for: %@", self, contact.UID);