-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMXMatrixAccount.m
More file actions
74 lines (59 loc) · 1.94 KB
/
MXMatrixAccount.m
File metadata and controls
74 lines (59 loc) · 1.94 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// MXMatrixAccount.m
// AdiumMatrix
//
// Based on microblog-purple created by jsippel on 1/7/09.
//
#import "MXMatrixAccount.h"
#import "libmatrix.h"
#import <Adium/AIStatus.h>
#import <Adium/ESDebugAILog.h>
@implementation MXMatrixAccount
- (const char *)protocolPlugin
{
return PRPL_ID;
}
- (PurpleAccount *)getPurpleAccount {
return account;
}
// Bridge Adium settings over to the libpurple side
- (void) configurePurpleAccount
{
AILog(@"Configuring Matrix Plugin");
[super configurePurpleAccount];
//
// NSString* steam_guard_code;
//
// //Default encoding
// if ((steam_guard_code = [self preferenceForKey:@"steam_guard_code" group:GROUP_ACCOUNT_STATUS])) {
// purple_account_set_string(account, "steam_guard_code", [steam_guard_code UTF8String]);
// }
//
// NSString* identifyAs;
// if ((identifyAs = [self preferenceForKey:@"ui_mode" group:GROUP_ACCOUNT_STATUS])) {
// purple_account_set_string(account, "ui_mode", [identifyAs UTF8String]);
// }
//
// purple_account_set_bool(account, "always_use_https", [[self preferenceForKey:@"always_use_https" group:GROUP_ACCOUNT_STATUS] boolValue]);
// purple_account_set_bool(account, "change_status_to_game", [[self preferenceForKey:@"change_status_to_game" group:GROUP_ACCOUNT_STATUS] boolValue]);
// purple_account_set_bool(account, "download_offline_history", [[self preferenceForKey:@"download_offline_history" group:GROUP_ACCOUNT_STATUS] boolValue]);
}
- (NSString *)host
{
return @"matrix.org";
}
- (const char *)purpleStatusIDForStatus:(AIStatus *)statusState
arguments:(NSMutableDictionary *)arguments
{
char *statusID = NULL;
switch (statusState.statusType) {
case AIAvailableStatusType:
statusID = "Online";
break;
case AIOfflineStatusType:
statusID = "Offline";
break;
}
return statusID;
}
@end