purple: take renamed API 3.x.x headers in use
[siplcs.git] / src / adium / DCPurpleSIPEJoinChatViewController.m
blob12e36033da8275525cba22bbd78d3c6b15d6b4f9
1 //
2 //  DCPurpleSIPEJoinChatViewController.m
3 //  SIPEAdiumPlugin
4 //
5 //  Created by Michael Lamb on 02/10/12.
6 //  Copyright 2012 Michael Lamb. All rights reserved.
7 //
9 #import "DCPurpleSIPEJoinChatViewController.h"
10 #import <Adium/AIChatControllerProtocol.h>
11 #import "DCJoinChatWindowController.h"
12 #import <Adium/AIAccount.h>
14 @implementation DCPurpleSIPEJoinChatViewController
16 - (id)init
18         if ((self = [super init]))
19         {
20                 [textField_inviteUsers setDragDelegate:self];
21                 [textField_inviteUsers registerForDraggedTypes:[NSArray arrayWithObjects:@"AIListObject", @"AIListObjectUniqueIDs", nil]];
22         }
23         
24         return self;
27 - (void)configureForAccount:(AIAccount *)inAccount
29         [super configureForAccount:inAccount];
30         if ( delegate )
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:
47                      room, @"room",
48                      nil];
50  if (handle) {
51      [chatCreationInfo setObject:handle
52                           forKey:@"handle"];
53  }
56  [self doJoinChatWithName:[NSString stringWithFormat:@"%@",room]
57                 onAccount:inAccount
58          chatCreationInfo:chatCreationInfo
59          invitingContacts:[self contactsFromNamesSeparatedByCommas:[textField_inviteUsers stringValue] onAccount:inAccount]
60     withInvitationMessage:(([invitemsg length]) ? invitemsg : nil)];
64 - (NSString *)nibName
66         return @"DCPurpleSIPEJoinChatView";
69 @end