-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAddContactWindowController.m
More file actions
46 lines (42 loc) · 1002 Bytes
/
AddContactWindowController.m
File metadata and controls
46 lines (42 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// AddContactWindowController.m
// Jabber
//
// Created by David Chisnall on 07/12/2004.
// Copyright 2004 __MyCompanyName__. All rights reserved.
//
#import <XMPPKit/XMPPRoster.h>
#import <XMPPKit/JID.h>
#import "AddContactWindowController.h"
#import "JabberApp.h"
@implementation AddContactWindowController
- (IBAction) addPerson:(id)_sender
{
NSString * rosterName = [name stringValue];
NSString * rosterGroup = [group stringValue];
JID * newJID = [JID jidWithString:[jid stringValue]];
if([rosterName isEqualToString:@""])
{
return;
}
if(newJID == nil)
{
return;
}
[[[(JabberApp*)[NSApp delegate] account] roster] subscribe:newJID
withName:rosterName
inGroup:rosterGroup];
[[self window] performClose:self];
[name setStringValue:@""];
[group setStringValue:@""];
[jid setStringValue:@""];
}
- (IBAction) cancel:(id)_sender
{
[[self window] performClose:self];
}
- (IBAction) showWindow:(id)_sender
{
[super showWindow:_sender];
}
@end