-
Notifications
You must be signed in to change notification settings - Fork 3
/
HideMenuController.m
59 lines (56 loc) · 1.9 KB
/
HideMenuController.m
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
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// HideMenuController.m
// Jabber
//
// Created by David Chisnall on 09/10/2004.
// Copyright 2004 __MyCompanyName__. All rights reserved.
//
#import <XMPPKit/XMPPPresence.h>
#import <XMPPKit/XMPPRoster.h>
#import "HideMenuController.h"
#import "TRUserDefaults.h"
#import "JabberApp.h"
#import "RosterController.h"
//TODO: Get rid of all of these messy [NSApp delegate] things.
@implementation HideMenuController
- (IBAction) away:(id) sender
{
[current setState:NSOffState];
[sender setState:NSOnState];
current = sender;
[[NSUserDefaults standardUserDefaults] setPresence:PRESENCE_AWAY forKey:@"HiddenPresences"];
[(RosterController*)[[[(JabberApp*)[NSApp delegate] account] roster] delegate] update:nil];
}
- (IBAction) xa:(id) sender
{
[current setState:NSOffState];
[sender setState:NSOnState];
current = sender;
[[NSUserDefaults standardUserDefaults] setPresence:PRESENCE_XA forKey:@"HiddenPresences"];
[(RosterController*)[[[(JabberApp*)[NSApp delegate] account] roster] delegate] update:nil];
}
- (IBAction) dnd:(id) sender
{
[current setState:NSOffState];
[sender setState:NSOnState];
current = sender;
[[NSUserDefaults standardUserDefaults] setPresence:PRESENCE_DND forKey:@"HiddenPresences"];
[(RosterController*)[[[(JabberApp*)[NSApp delegate] account] roster] delegate] update:nil];
}
- (IBAction) offline:(id) sender
{
[current setState:NSOffState];
[sender setState:NSOnState];
current = sender;
[[NSUserDefaults standardUserDefaults] setPresence:PRESENCE_OFFLINE forKey:@"HiddenPresences"];
[(RosterController*)[[[(JabberApp*)[NSApp delegate] account] roster] delegate] update:nil];
}
- (IBAction) none:(id) sender
{
[current setState:NSOffState];
[sender setState:NSOnState];
current = sender;
[[NSUserDefaults standardUserDefaults] setPresence:PRESENCE_UNKNOWN + 10 forKey:@"HiddenPresences"];
[(RosterController*)[[[(JabberApp*)[NSApp delegate] account] roster] delegate] update:nil];
}
@end