2 // DCPurpleSIPEJoinChatViewController.m
5 // Created by Michael Lamb on 02/10/12.
6 // Copyright 2012 Michael Lamb. All rights reserved.
9 #import "DCPurpleSIPEJoinChatViewController.h"
10 #import <Adium/AIChatControllerProtocol.h>
11 #import "DCJoinChatWindowController.h"
12 #import <Adium/AIAccount.h>
14 @implementation DCPurpleSIPEJoinChatViewController
18 if ((self = [super init]))
20 [textField_inviteUsers setDragDelegate:self];
21 [textField_inviteUsers registerForDraggedTypes:[NSArray arrayWithObjects:@"AIListObject", @"AIListObjectUniqueIDs", nil]];
27 - (void)configureForAccount:(AIAccount *)inAccount
29 [super configureForAccount:inAccount];
31 [(DCJoinChatWindowController *)delegate setJoinChatEnabled:YES];
36 - (void)joinChatWithAccount:(AIAccount *)inAccount
39 NSString *room = [textField_roomName stringValue];
40 NSString *handle = [textField_handle stringValue];
41 NSString *invitemsg = [textField_inviteMessage stringValue];
42 NSMutableDictionary *chatCreationInfo;
44 if (![handle length]) handle = nil;
46 chatCreationInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:
51 [chatCreationInfo setObject:handle
56 [self doJoinChatWithName:[NSString stringWithFormat:@"%@",room]
58 chatCreationInfo:chatCreationInfo
59 invitingContacts:[self contactsFromNamesSeparatedByCommas:[textField_inviteUsers stringValue] onAccount:inAccount]
60 withInvitationMessage:(([invitemsg length]) ? invitemsg : nil)];
66 return @"DCPurpleSIPEJoinChatView";