Permalink
Browse files

Allow for removing contacts

  • Loading branch information...
1 parent 97a7580 commit 14284b64d40c2b237c3a482b21f819810338e4e5 @benlangfeld committed Nov 7, 2010
Showing with 13 additions and 0 deletions.
  1. +13 −0 Controllers/AccountsController.j
View
13 Controllers/AccountsController.j
@@ -302,6 +302,19 @@ var SharedController = nil;
- (@action)removeContact:(id)aSender
{
CPLog.debug("Removing a contact");
+ var contact = [self selectedItem];
+ if ([contact isKindOfClass:[TNStropheContact class]])
+ [[[self accountForContact:contact] roster] removeContact:contact];
+}
+
+- (Account)accountForContact:(TNStropheContact)aContact
+{
+ for (var i = 0; i < [accounts count]; i++)
+ {
+ var account = [accounts objectAtIndex:i];
+ if ([[account roster] containsJID:[aContact JID]])
+ return account;
+ }
}

0 comments on commit 14284b6

Please sign in to comment.