Tue, 03 Feb 2009 05:39:47 +0000
For some reason, all these statuses were set to saveable=FALSE. With the
recent change to not save those, this broke stuff like re-use last status
on startup with certain statuses (like invisible on MSN).
Fixes #8316.
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1 | /* |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
3 | silcpurple.c |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
4 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
5 | Author: Pekka Riikonen <priikone@silcnet.org> |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
6 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
7 | Copyright (C) 2004 - 2005 Pekka Riikonen |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
8 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
9 | This program is free software; you can redistribute it and/or modify |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
10 | it under the terms of the GNU General Public License as published by |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
11 | the Free Software Foundation; version 2 of the License. |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
12 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
13 | This program is distributed in the hope that it will be useful, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
16 | GNU General Public License for more details. |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
17 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
18 | */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
19 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
20 | #include "silcincludes.h" |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
21 | #include "silcclient.h" |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
22 | #include "silcpurple.h" |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
23 | #include "version.h" |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
24 | #include "wb.h" |
|
23551
b6109bbbbe6c
Added include for "core.h" to silc. Fix from phroggie, thanks. Fixes #6227
Evan Schoenberg <evands@pidgin.im>
parents:
23545
diff
changeset
|
25 | #include "core.h" |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
26 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
27 | extern SilcClientOperations ops; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
28 | static PurplePlugin *silc_plugin = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
29 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
30 | static const char * |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
31 | silcpurple_list_icon(PurpleAccount *a, PurpleBuddy *b) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
32 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
33 | return (const char *)"silc"; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
34 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
35 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
36 | static GList * |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
37 | silcpurple_away_states(PurpleAccount *account) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
38 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
39 | PurpleStatusType *type; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
40 | GList *types = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
41 | |
|
25552
ffd94785b2ad
For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23551
diff
changeset
|
42 | type = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE, SILCPURPLE_STATUS_ID_AVAILABLE, NULL, TRUE, TRUE, FALSE); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
43 | types = g_list_append(types, type); |
|
25552
ffd94785b2ad
For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23551
diff
changeset
|
44 | type = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE, SILCPURPLE_STATUS_ID_HYPER, _("Hyper Active"), TRUE, TRUE, FALSE); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
45 | types = g_list_append(types, type); |
|
25552
ffd94785b2ad
For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23551
diff
changeset
|
46 | type = purple_status_type_new_full(PURPLE_STATUS_AWAY, SILCPURPLE_STATUS_ID_AWAY, NULL, TRUE, TRUE, FALSE); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
47 | types = g_list_append(types, type); |
|
25552
ffd94785b2ad
For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23551
diff
changeset
|
48 | type = purple_status_type_new_full(PURPLE_STATUS_UNAVAILABLE, SILCPURPLE_STATUS_ID_BUSY, _("Busy"), TRUE, TRUE, FALSE); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
49 | types = g_list_append(types, type); |
|
25552
ffd94785b2ad
For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23551
diff
changeset
|
50 | type = purple_status_type_new_full(PURPLE_STATUS_AWAY, SILCPURPLE_STATUS_ID_INDISPOSED, _("Indisposed"), TRUE, TRUE, FALSE); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
51 | types = g_list_append(types, type); |
|
25552
ffd94785b2ad
For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23551
diff
changeset
|
52 | type = purple_status_type_new_full(PURPLE_STATUS_AWAY, SILCPURPLE_STATUS_ID_PAGE, _("Wake Me Up"), TRUE, TRUE, FALSE); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
53 | types = g_list_append(types, type); |
|
25552
ffd94785b2ad
For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23551
diff
changeset
|
54 | type = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, SILCPURPLE_STATUS_ID_OFFLINE, NULL, TRUE, TRUE, FALSE); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
55 | types = g_list_append(types, type); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
56 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
57 | return types; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
58 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
59 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
60 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
61 | silcpurple_set_status(PurpleAccount *account, PurpleStatus *status) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
62 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
63 | PurpleConnection *gc = purple_account_get_connection(account); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
64 | SilcPurple sg = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
65 | SilcUInt32 mode; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
66 | SilcBuffer idp; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
67 | unsigned char mb[4]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
68 | const char *state; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
69 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
70 | if (gc != NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
71 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
72 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
73 | if (status == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
74 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
75 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
76 | state = purple_status_get_id(status); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
77 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
78 | if (state == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
79 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
80 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
81 | if ((sg == NULL) || (sg->conn == NULL)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
82 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
83 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
84 | mode = sg->conn->local_entry->mode; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
85 | mode &= ~(SILC_UMODE_GONE | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
86 | SILC_UMODE_HYPER | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
87 | SILC_UMODE_BUSY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
88 | SILC_UMODE_INDISPOSED | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
89 | SILC_UMODE_PAGE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
90 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
91 | if (!strcmp(state, "hyper")) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
92 | mode |= SILC_UMODE_HYPER; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
93 | else if (!strcmp(state, "away")) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
94 | mode |= SILC_UMODE_GONE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
95 | else if (!strcmp(state, "busy")) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
96 | mode |= SILC_UMODE_BUSY; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
97 | else if (!strcmp(state, "indisposed")) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
98 | mode |= SILC_UMODE_INDISPOSED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
99 | else if (!strcmp(state, "page")) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
100 | mode |= SILC_UMODE_PAGE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
101 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
102 | /* Send UMODE */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
103 | idp = silc_id_payload_encode(sg->conn->local_id, SILC_ID_CLIENT); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
104 | SILC_PUT32_MSB(mode, mb); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
105 | silc_client_command_send(sg->client, sg->conn, SILC_COMMAND_UMODE, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
106 | ++sg->conn->cmd_ident, 2, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
107 | 1, idp->data, idp->len, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
108 | 2, mb, sizeof(mb)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
109 | silc_buffer_free(idp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
110 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
111 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
112 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
113 | /*************************** Connection Routines *****************************/ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
114 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
115 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
116 | silcpurple_keepalive(PurpleConnection *gc) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
117 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
118 | SilcPurple sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
119 | silc_client_send_packet(sg->client, sg->conn, SILC_PACKET_HEARTBEAT, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
120 | NULL, 0); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
121 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
122 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
123 | static gboolean |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
124 | silcpurple_scheduler(gpointer *context) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
125 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
126 | SilcPurple sg = (SilcPurple)context; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
127 | silc_client_run_one(sg->client); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
128 | return TRUE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
129 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
130 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
131 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
132 | silcpurple_nickname_parse(const char *nickname, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
133 | char **ret_nickname) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
134 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
135 | silc_parse_userfqdn(nickname, ret_nickname, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
136 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
137 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
138 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
139 | silcpurple_login_connected(gpointer data, gint source, const gchar *error_message) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
140 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
141 | PurpleConnection *gc = data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
142 | SilcPurple sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
143 | SilcClient client; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
144 | SilcClientConnection conn; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
145 | PurpleAccount *account; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
146 | SilcClientConnectionParams params; |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
147 | SilcUInt32 mask; |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
148 | const char *dfile, *tmp; |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
149 | #ifdef SILC_ATTRIBUTE_USER_ICON |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
150 | PurpleStoredImage *img; |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
151 | #endif |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
152 | #ifdef HAVE_SYS_UTSNAME_H |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
153 | struct utsname u; |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
154 | #endif |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
155 | |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
156 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
157 | g_return_if_fail(gc != NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
158 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
159 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
160 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
161 | if (source < 0) { |
|
22363
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
162 | purple_connection_error_reason(gc, |
|
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
163 | PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
164 | _("Connection failed")); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
165 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
166 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
167 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
168 | client = sg->client; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
169 | account = sg->account; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
170 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
171 | /* Get session detachment data, if available */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
172 | memset(¶ms, 0, sizeof(params)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
173 | dfile = silcpurple_session_file(purple_account_get_username(sg->account)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
174 | params.detach_data = (unsigned char *)silc_file_readfile(dfile, ¶ms.detach_data_len); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
175 | if (params.detach_data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
176 | params.detach_data[params.detach_data_len] = 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
177 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
178 | /* Add connection to SILC client library */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
179 | conn = silc_client_add_connection( |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
180 | sg->client, ¶ms, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
181 | (char *)purple_account_get_string(account, "server", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
182 | "silc.silcnet.org"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
183 | purple_account_get_int(account, "port", 706), sg); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
184 | if (!conn) { |
|
22363
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
185 | purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
186 | _("Cannot initialize SILC Client connection")); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
187 | gc->proto_data = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
188 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
189 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
190 | sg->conn = conn; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
191 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
192 | /* Progress */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
193 | if (params.detach_data) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
194 | purple_connection_update_progress(gc, _("Resuming session"), 2, 5); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
195 | sg->resuming = TRUE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
196 | } else { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
197 | purple_connection_update_progress(gc, _("Performing key exchange"), 2, 5); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
198 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
199 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
200 | /* Perform SILC Key Exchange. The "silc_connected" will be called |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
201 | eventually. */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
202 | silc_client_start_key_exchange(sg->client, sg->conn, source); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
203 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
204 | /* Set default attributes */ |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
205 | mask = SILC_ATTRIBUTE_MOOD_NORMAL; |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
206 | silc_client_attribute_add(client, conn, |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
207 | SILC_ATTRIBUTE_STATUS_MOOD, |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
208 | SILC_32_TO_PTR(mask), |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
209 | sizeof(SilcUInt32)); |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
210 | mask = SILC_ATTRIBUTE_CONTACT_CHAT; |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
211 | silc_client_attribute_add(client, conn, |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
212 | SILC_ATTRIBUTE_PREFERRED_CONTACT, |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
213 | SILC_32_TO_PTR(mask), |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
214 | sizeof(SilcUInt32)); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
215 | #ifdef HAVE_SYS_UTSNAME_H |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
216 | if (!uname(&u)) { |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
217 | SilcAttributeObjDevice dev; |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
218 | memset(&dev, 0, sizeof(dev)); |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
219 | dev.type = SILC_ATTRIBUTE_DEVICE_COMPUTER; |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
220 | dev.version = u.release; |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
221 | dev.model = u.sysname; |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
222 | silc_client_attribute_add(client, conn, |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
223 | SILC_ATTRIBUTE_DEVICE_INFO, |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
224 | (void *)&dev, sizeof(dev)); |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
225 | } |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
226 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
227 | #ifdef _WIN32 |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
228 | tmp = _tzname[0]; |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
229 | #else |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
230 | tmp = tzname[0]; |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
231 | #endif |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
232 | silc_client_attribute_add(client, conn, |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
233 | SILC_ATTRIBUTE_TIMEZONE, |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
234 | (void *)tmp, strlen(tmp)); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
235 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
236 | #ifdef SILC_ATTRIBUTE_USER_ICON |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
237 | /* Set our buddy icon */ |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
238 | img = purple_buddy_icons_find_account_icon(account); |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
239 | silcpurple_buddy_set_icon(gc, img); |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
240 | purple_imgstore_unref(img); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
241 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
242 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
243 | silc_free(params.detach_data); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
244 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
245 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
246 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
247 | silcpurple_login(PurpleAccount *account) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
248 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
249 | SilcPurple sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
250 | SilcClient client; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
251 | SilcClientParams params; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
252 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
253 | char pkd[256], prd[256]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
254 | const char *cipher, *hmac; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
255 | char *realname; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
256 | int i; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
257 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
258 | gc = account->gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
259 | if (!gc) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
260 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
261 | gc->proto_data = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
262 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
263 | memset(¶ms, 0, sizeof(params)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
264 | strcat(params.nickname_format, "%n@%h%a"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
265 | params.nickname_parse = silcpurple_nickname_parse; |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
266 | params.ignore_requested_attributes = FALSE; |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
267 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
268 | /* Allocate SILC client */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
269 | client = silc_client_alloc(&ops, ¶ms, gc, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
270 | if (!client) { |
|
22363
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
271 | purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, |
|
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
272 | _("Out of memory")); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
273 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
274 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
275 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
276 | /* Get username, real name and local hostname for SILC library */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
277 | if (purple_account_get_username(account)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
278 | const char *u = purple_account_get_username(account); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
279 | char **up = g_strsplit(u, "@", 2); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
280 | client->username = strdup(up[0]); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
281 | g_strfreev(up); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
282 | } else { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
283 | client->username = silc_get_username(); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
284 | purple_account_set_username(account, client->username); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
285 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
286 | realname = silc_get_real_name(); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
287 | if (purple_account_get_user_info(account)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
288 | client->realname = strdup(purple_account_get_user_info(account)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
289 | free(realname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
290 | } else if ((silc_get_real_name() != NULL) && (*realname != '\0')) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
291 | client->realname = realname; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
292 | purple_account_set_user_info(account, client->realname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
293 | } else { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
294 | free(realname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
295 | client->realname = strdup(_("John Noname")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
296 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
297 | client->hostname = silc_net_localhost(); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
298 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
299 | purple_connection_set_display_name(gc, client->username); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
300 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
301 | /* Register requested cipher and HMAC */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
302 | cipher = purple_account_get_string(account, "cipher", SILC_DEFAULT_CIPHER); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
303 | for (i = 0; silc_default_ciphers[i].name; i++) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
304 | if (!strcmp(silc_default_ciphers[i].name, cipher)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
305 | silc_cipher_register(&(silc_default_ciphers[i])); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
306 | break; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
307 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
308 | hmac = purple_account_get_string(account, "hmac", SILC_DEFAULT_HMAC); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
309 | for (i = 0; silc_default_hmacs[i].name; i++) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
310 | if (!strcmp(silc_default_hmacs[i].name, hmac)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
311 | silc_hmac_register(&(silc_default_hmacs[i])); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
312 | break; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
313 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
314 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
315 | /* Init SILC client */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
316 | if (!silc_client_init(client)) { |
|
22363
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
317 | purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, |
|
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
318 | _("Cannot initialize SILC protocol")); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
319 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
320 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
321 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
322 | /* Check the ~/.silc dir and create it, and new key pair if necessary. */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
323 | if (!silcpurple_check_silc_dir(gc)) { |
|
22363
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
324 | purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, |
|
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
325 | _("Error loading SILC key pair")); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
326 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
327 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
328 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
329 | /* Progress */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
330 | purple_connection_update_progress(gc, _("Connecting to SILC Server"), 1, 5); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
331 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
332 | /* Load SILC key pair */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
333 | g_snprintf(pkd, sizeof(pkd), "%s" G_DIR_SEPARATOR_S "public_key.pub", silcpurple_silcdir()); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
334 | g_snprintf(prd, sizeof(prd), "%s" G_DIR_SEPARATOR_S "private_key.prv", silcpurple_silcdir()); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
335 | if (!silc_load_key_pair((char *)purple_account_get_string(account, "public-key", pkd), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
336 | (char *)purple_account_get_string(account, "private-key", prd), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
337 | (gc->password == NULL) ? "" : gc->password, &client->pkcs, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
338 | &client->public_key, &client->private_key)) { |
|
21389
e1dd8142bb87
replace most calls to strerror with calls to g_strerror. strerror will return
Nathan Walp <nwalp@pidgin.im>
parents:
18143
diff
changeset
|
339 | g_snprintf(pkd, sizeof(pkd), _("Could not load SILC key pair: %s"), g_strerror(errno)); |
|
22363
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
340 | purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, |
|
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
341 | _("Could not load SILC key pair")); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
342 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
343 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
344 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
345 | sg = silc_calloc(1, sizeof(*sg)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
346 | if (!sg) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
347 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
348 | memset(sg, 0, sizeof(*sg)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
349 | sg->client = client; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
350 | sg->gc = gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
351 | sg->account = account; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
352 | gc->proto_data = sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
353 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
354 | /* Connect to the SILC server */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
355 | if (purple_proxy_connect(gc, account, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
356 | purple_account_get_string(account, "server", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
357 | "silc.silcnet.org"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
358 | purple_account_get_int(account, "port", 706), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
359 | silcpurple_login_connected, gc) == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
360 | { |
|
22363
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
361 | purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
a3c57f0331d5
Update silc10 to use purple_connection_error_reason(), matching the uses in
Will Thompson <resiak@pidgin.im>
parents:
21630
diff
changeset
|
362 | _("Unable to create connection")); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
363 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
364 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
365 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
366 | /* Schedule SILC using Glib's event loop */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
367 | sg->scheduler = purple_timeout_add(300, (GSourceFunc)silcpurple_scheduler, sg); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
368 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
369 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
370 | static int |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
371 | silcpurple_close_final(gpointer *context) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
372 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
373 | SilcPurple sg = (SilcPurple)context; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
374 | silc_client_stop(sg->client); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
375 | silc_client_free(sg->client); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
376 | #ifdef HAVE_SILCMIME_H |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
377 | if (sg->mimeass) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
378 | silc_mime_assembler_free(sg->mimeass); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
379 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
380 | silc_free(sg); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
381 | return 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
382 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
383 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
384 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
385 | silcpurple_close(PurpleConnection *gc) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
386 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
387 | SilcPurple sg = gc->proto_data; |
|
23545
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
388 | GHashTable *ui_info; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
389 | const char *ui_name = NULL, *ui_website = NULL; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
390 | char *quit_msg; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
391 | |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
392 | g_return_if_fail(sg != NULL); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
393 | |
|
23545
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
394 | ui_info = purple_core_get_ui_info(); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
395 | |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
396 | if(ui_info) { |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
397 | ui_name = g_hash_table_lookup(ui_info, "name"); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
398 | ui_website = g_hash_table_lookup(ui_info, "website"); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
399 | } |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
400 | |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
401 | if(!ui_name || !ui_website) { |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
402 | ui_name = "Pidgin"; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
403 | ui_website = PURPLE_WEBSITE; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
404 | } |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
405 | quit_msg = g_strdup_printf(_("Download %s: %s"), |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
406 | ui_name, ui_website); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
407 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
408 | /* Send QUIT */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
409 | silc_client_command_call(sg->client, sg->conn, NULL, |
|
23545
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
410 | "QUIT", quit_msg, NULL); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
411 | g_free(quit_msg); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
412 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
413 | if (sg->conn) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
414 | silc_client_close_connection(sg->client, sg->conn); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
415 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
416 | purple_timeout_remove(sg->scheduler); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
417 | purple_timeout_add(1, (GSourceFunc)silcpurple_close_final, sg); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
418 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
419 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
420 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
421 | /****************************** Protocol Actions *****************************/ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
422 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
423 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
424 | silcpurple_attrs_cancel(PurpleConnection *gc, PurpleRequestFields *fields) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
425 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
426 | /* Nothing */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
427 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
428 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
429 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
430 | silcpurple_attrs_cb(PurpleConnection *gc, PurpleRequestFields *fields) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
431 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
432 | SilcPurple sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
433 | SilcClient client = sg->client; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
434 | SilcClientConnection conn = sg->conn; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
435 | PurpleRequestField *f; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
436 | char *tmp; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
437 | SilcUInt32 tmp_len, mask; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
438 | SilcAttributeObjService service; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
439 | SilcAttributeObjDevice dev; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
440 | SilcVCardStruct vcard; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
441 | const char *val; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
442 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
443 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
444 | if (!sg) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
445 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
446 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
447 | memset(&service, 0, sizeof(service)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
448 | memset(&dev, 0, sizeof(dev)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
449 | memset(&vcard, 0, sizeof(vcard)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
450 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
451 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
452 | SILC_ATTRIBUTE_USER_INFO, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
453 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
454 | SILC_ATTRIBUTE_SERVICE, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
455 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
456 | SILC_ATTRIBUTE_STATUS_MOOD, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
457 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
458 | SILC_ATTRIBUTE_STATUS_FREETEXT, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
459 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
460 | SILC_ATTRIBUTE_STATUS_MESSAGE, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
461 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
462 | SILC_ATTRIBUTE_PREFERRED_LANGUAGE, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
463 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
464 | SILC_ATTRIBUTE_PREFERRED_CONTACT, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
465 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
466 | SILC_ATTRIBUTE_TIMEZONE, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
467 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
468 | SILC_ATTRIBUTE_GEOLOCATION, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
469 | silc_client_attribute_del(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
470 | SILC_ATTRIBUTE_DEVICE_INFO, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
471 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
472 | /* Set mood */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
473 | mask = 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
474 | f = purple_request_fields_get_field(fields, "mood_normal"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
475 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
476 | mask |= SILC_ATTRIBUTE_MOOD_NORMAL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
477 | f = purple_request_fields_get_field(fields, "mood_happy"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
478 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
479 | mask |= SILC_ATTRIBUTE_MOOD_HAPPY; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
480 | f = purple_request_fields_get_field(fields, "mood_sad"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
481 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
482 | mask |= SILC_ATTRIBUTE_MOOD_SAD; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
483 | f = purple_request_fields_get_field(fields, "mood_angry"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
484 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
485 | mask |= SILC_ATTRIBUTE_MOOD_ANGRY; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
486 | f = purple_request_fields_get_field(fields, "mood_jealous"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
487 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
488 | mask |= SILC_ATTRIBUTE_MOOD_JEALOUS; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
489 | f = purple_request_fields_get_field(fields, "mood_ashamed"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
490 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
491 | mask |= SILC_ATTRIBUTE_MOOD_ASHAMED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
492 | f = purple_request_fields_get_field(fields, "mood_invincible"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
493 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
494 | mask |= SILC_ATTRIBUTE_MOOD_INVINCIBLE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
495 | f = purple_request_fields_get_field(fields, "mood_inlove"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
496 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
497 | mask |= SILC_ATTRIBUTE_MOOD_INLOVE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
498 | f = purple_request_fields_get_field(fields, "mood_sleepy"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
499 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
500 | mask |= SILC_ATTRIBUTE_MOOD_SLEEPY; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
501 | f = purple_request_fields_get_field(fields, "mood_bored"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
502 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
503 | mask |= SILC_ATTRIBUTE_MOOD_BORED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
504 | f = purple_request_fields_get_field(fields, "mood_excited"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
505 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
506 | mask |= SILC_ATTRIBUTE_MOOD_EXCITED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
507 | f = purple_request_fields_get_field(fields, "mood_anxious"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
508 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
509 | mask |= SILC_ATTRIBUTE_MOOD_ANXIOUS; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
510 | silc_client_attribute_add(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
511 | SILC_ATTRIBUTE_STATUS_MOOD, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
512 | SILC_32_TO_PTR(mask), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
513 | sizeof(SilcUInt32)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
514 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
515 | /* Set preferred contact */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
516 | mask = 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
517 | f = purple_request_fields_get_field(fields, "contact_chat"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
518 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
519 | mask |= SILC_ATTRIBUTE_CONTACT_CHAT; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
520 | f = purple_request_fields_get_field(fields, "contact_email"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
521 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
522 | mask |= SILC_ATTRIBUTE_CONTACT_EMAIL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
523 | f = purple_request_fields_get_field(fields, "contact_call"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
524 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
525 | mask |= SILC_ATTRIBUTE_CONTACT_CALL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
526 | f = purple_request_fields_get_field(fields, "contact_sms"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
527 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
528 | mask |= SILC_ATTRIBUTE_CONTACT_SMS; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
529 | f = purple_request_fields_get_field(fields, "contact_mms"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
530 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
531 | mask |= SILC_ATTRIBUTE_CONTACT_MMS; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
532 | f = purple_request_fields_get_field(fields, "contact_video"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
533 | if (f && purple_request_field_bool_get_value(f)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
534 | mask |= SILC_ATTRIBUTE_CONTACT_VIDEO; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
535 | if (mask) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
536 | silc_client_attribute_add(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
537 | SILC_ATTRIBUTE_PREFERRED_CONTACT, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
538 | SILC_32_TO_PTR(mask), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
539 | sizeof(SilcUInt32)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
540 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
541 | /* Set status text */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
542 | val = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
543 | f = purple_request_fields_get_field(fields, "status_text"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
544 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
545 | val = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
546 | if (val && *val) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
547 | silc_client_attribute_add(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
548 | SILC_ATTRIBUTE_STATUS_FREETEXT, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
549 | (void *)val, strlen(val)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
550 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
551 | /* Set vcard */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
552 | val = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
553 | f = purple_request_fields_get_field(fields, "vcard"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
554 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
555 | val = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
556 | if (val && *val) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
557 | purple_account_set_string(sg->account, "vcard", val); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
558 | tmp = silc_file_readfile(val, &tmp_len); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
559 | if (tmp) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
560 | tmp[tmp_len] = 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
561 | if (silc_vcard_decode((unsigned char *)tmp, tmp_len, &vcard)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
562 | silc_client_attribute_add(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
563 | SILC_ATTRIBUTE_USER_INFO, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
564 | (void *)&vcard, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
565 | sizeof(vcard)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
566 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
567 | silc_vcard_free(&vcard); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
568 | silc_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
569 | } else { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
570 | purple_account_set_string(sg->account, "vcard", ""); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
571 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
572 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
573 | #ifdef HAVE_SYS_UTSNAME_H |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
574 | /* Set device info */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
575 | f = purple_request_fields_get_field(fields, "device"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
576 | if (f && purple_request_field_bool_get_value(f)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
577 | struct utsname u; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
578 | if (!uname(&u)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
579 | dev.type = SILC_ATTRIBUTE_DEVICE_COMPUTER; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
580 | dev.version = u.release; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
581 | dev.model = u.sysname; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
582 | silc_client_attribute_add(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
583 | SILC_ATTRIBUTE_DEVICE_INFO, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
584 | (void *)&dev, sizeof(dev)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
585 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
586 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
587 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
588 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
589 | /* Set timezone */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
590 | val = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
591 | f = purple_request_fields_get_field(fields, "timezone"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
592 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
593 | val = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
594 | if (val && *val) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
595 | silc_client_attribute_add(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
596 | SILC_ATTRIBUTE_TIMEZONE, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
597 | (void *)val, strlen(val)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
598 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
599 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
600 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
601 | silcpurple_attrs(PurplePluginAction *action) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
602 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
603 | PurpleConnection *gc = (PurpleConnection *) action->context; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
604 | SilcPurple sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
605 | SilcClient client = sg->client; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
606 | SilcClientConnection conn = sg->conn; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
607 | PurpleRequestFields *fields; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
608 | PurpleRequestFieldGroup *g; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
609 | PurpleRequestField *f; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
610 | SilcHashTable attrs; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
611 | SilcAttributePayload attr; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
612 | gboolean mnormal = TRUE, mhappy = FALSE, msad = FALSE, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
613 | mangry = FALSE, mjealous = FALSE, mashamed = FALSE, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
614 | minvincible = FALSE, minlove = FALSE, msleepy = FALSE, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
615 | mbored = FALSE, mexcited = FALSE, manxious = FALSE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
616 | gboolean cemail = FALSE, ccall = FALSE, csms = FALSE, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
617 | cmms = FALSE, cchat = TRUE, cvideo = FALSE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
618 | gboolean device = TRUE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
619 | char status[1024]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
620 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
621 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
622 | if (!sg) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
623 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
624 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
625 | memset(status, 0, sizeof(status)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
626 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
627 | attrs = silc_client_attributes_get(client, conn); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
628 | if (attrs) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
629 | if (silc_hash_table_find(attrs, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
630 | SILC_32_TO_PTR(SILC_ATTRIBUTE_STATUS_MOOD), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
631 | NULL, (void *)&attr)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
632 | SilcUInt32 mood = 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
633 | silc_attribute_get_object(attr, &mood, sizeof(mood)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
634 | mnormal = !mood; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
635 | mhappy = (mood & SILC_ATTRIBUTE_MOOD_HAPPY); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
636 | msad = (mood & SILC_ATTRIBUTE_MOOD_SAD); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
637 | mangry = (mood & SILC_ATTRIBUTE_MOOD_ANGRY); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
638 | mjealous = (mood & SILC_ATTRIBUTE_MOOD_JEALOUS); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
639 | mashamed = (mood & SILC_ATTRIBUTE_MOOD_ASHAMED); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
640 | minvincible = (mood & SILC_ATTRIBUTE_MOOD_INVINCIBLE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
641 | minlove = (mood & SILC_ATTRIBUTE_MOOD_INLOVE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
642 | msleepy = (mood & SILC_ATTRIBUTE_MOOD_SLEEPY); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
643 | mbored = (mood & SILC_ATTRIBUTE_MOOD_BORED); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
644 | mexcited = (mood & SILC_ATTRIBUTE_MOOD_EXCITED); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
645 | manxious = (mood & SILC_ATTRIBUTE_MOOD_ANXIOUS); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
646 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
647 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
648 | if (silc_hash_table_find(attrs, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
649 | SILC_32_TO_PTR(SILC_ATTRIBUTE_PREFERRED_CONTACT), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
650 | NULL, (void *)&attr)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
651 | SilcUInt32 contact = 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
652 | silc_attribute_get_object(attr, &contact, sizeof(contact)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
653 | cemail = (contact & SILC_ATTRIBUTE_CONTACT_EMAIL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
654 | ccall = (contact & SILC_ATTRIBUTE_CONTACT_CALL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
655 | csms = (contact & SILC_ATTRIBUTE_CONTACT_SMS); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
656 | cmms = (contact & SILC_ATTRIBUTE_CONTACT_MMS); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
657 | cchat = (contact & SILC_ATTRIBUTE_CONTACT_CHAT); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
658 | cvideo = (contact & SILC_ATTRIBUTE_CONTACT_VIDEO); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
659 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
660 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
661 | if (silc_hash_table_find(attrs, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
662 | SILC_32_TO_PTR(SILC_ATTRIBUTE_STATUS_FREETEXT), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
663 | NULL, (void *)&attr)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
664 | silc_attribute_get_object(attr, &status, sizeof(status)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
665 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
666 | if (!silc_hash_table_find(attrs, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
667 | SILC_32_TO_PTR(SILC_ATTRIBUTE_DEVICE_INFO), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
668 | NULL, (void *)&attr)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
669 | device = FALSE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
670 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
671 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
672 | fields = purple_request_fields_new(); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
673 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
674 | g = purple_request_field_group_new(NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
675 | f = purple_request_field_label_new("l3", _("Your Current Mood")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
676 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
677 | f = purple_request_field_bool_new("mood_normal", _("Normal"), mnormal); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
678 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
679 | f = purple_request_field_bool_new("mood_happy", _("Happy"), mhappy); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
680 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
681 | f = purple_request_field_bool_new("mood_sad", _("Sad"), msad); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
682 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
683 | f = purple_request_field_bool_new("mood_angry", _("Angry"), mangry); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
684 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
685 | f = purple_request_field_bool_new("mood_jealous", _("Jealous"), mjealous); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
686 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
687 | f = purple_request_field_bool_new("mood_ashamed", _("Ashamed"), mashamed); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
688 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
689 | f = purple_request_field_bool_new("mood_invincible", _("Invincible"), minvincible); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
690 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
691 | f = purple_request_field_bool_new("mood_inlove", _("In love"), minlove); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
692 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
693 | f = purple_request_field_bool_new("mood_sleepy", _("Sleepy"), msleepy); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
694 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
695 | f = purple_request_field_bool_new("mood_bored", _("Bored"), mbored); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
696 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
697 | f = purple_request_field_bool_new("mood_excited", _("Excited"), mexcited); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
698 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
699 | f = purple_request_field_bool_new("mood_anxious", _("Anxious"), manxious); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
700 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
701 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
702 | f = purple_request_field_label_new("l4", _("\nYour Preferred Contact Methods")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
703 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
704 | f = purple_request_field_bool_new("contact_chat", _("Chat"), cchat); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
705 | purple_request_field_group_add_field(g, f); |
|
23325
a374a26fe217
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@pidgin.im>
parents:
23277
diff
changeset
|
706 | f = purple_request_field_bool_new("contact_email", _("Email"), cemail); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
707 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
708 | f = purple_request_field_bool_new("contact_call", _("Phone"), ccall); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
709 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
710 | f = purple_request_field_bool_new("contact_sms", _("SMS"), csms); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
711 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
712 | f = purple_request_field_bool_new("contact_mms", _("MMS"), cmms); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
713 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
714 | f = purple_request_field_bool_new("contact_video", _("Video conferencing"), cvideo); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
715 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
716 | purple_request_fields_add_group(fields, g); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
717 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
718 | g = purple_request_field_group_new(NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
719 | f = purple_request_field_string_new("status_text", _("Your Current Status"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
720 | status[0] ? status : NULL, TRUE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
721 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
722 | purple_request_fields_add_group(fields, g); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
723 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
724 | g = purple_request_field_group_new(NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
725 | #if 0 |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
726 | f = purple_request_field_label_new("l2", _("Online Services")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
727 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
728 | f = purple_request_field_bool_new("services", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
729 | _("Let others see what services you are using"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
730 | TRUE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
731 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
732 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
733 | #ifdef HAVE_SYS_UTSNAME_H |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
734 | f = purple_request_field_bool_new("device", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
735 | _("Let others see what computer you are using"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
736 | device); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
737 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
738 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
739 | purple_request_fields_add_group(fields, g); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
740 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
741 | g = purple_request_field_group_new(NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
742 | f = purple_request_field_string_new("vcard", _("Your VCard File"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
743 | purple_account_get_string(sg->account, "vcard", ""), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
744 | FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
745 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
746 | #ifdef _WIN32 |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
747 | f = purple_request_field_string_new("timezone", _("Timezone"), _tzname[0], FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
748 | #else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
749 | f = purple_request_field_string_new("timezone", _("Timezone"), tzname[0], FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
750 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
751 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
752 | purple_request_fields_add_group(fields, g); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
753 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
754 | purple_request_fields(gc, _("User Online Status Attributes"), |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
755 | _("User Online Status Attributes"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
756 | _("You can let other users see your online status information " |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
757 | "and your personal information. Please fill the information " |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
758 | "you would like other users to see about yourself."), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
759 | fields, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
760 | _("OK"), G_CALLBACK(silcpurple_attrs_cb), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
761 | _("Cancel"), G_CALLBACK(silcpurple_attrs_cancel), |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
762 | gc->account, NULL, NULL, gc); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
763 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
764 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
765 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
766 | silcpurple_detach(PurplePluginAction *action) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
767 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
768 | PurpleConnection *gc = (PurpleConnection *) action->context; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
769 | SilcPurple sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
770 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
771 | if (!gc) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
772 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
773 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
774 | if (!sg) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
775 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
776 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
777 | /* Call DETACH */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
778 | silc_client_command_call(sg->client, sg->conn, "DETACH"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
779 | sg->detaching = TRUE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
780 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
781 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
782 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
783 | silcpurple_view_motd(PurplePluginAction *action) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
784 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
785 | PurpleConnection *gc = (PurpleConnection *) action->context; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
786 | SilcPurple sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
787 | char *tmp; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
788 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
789 | if (!gc) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
790 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
791 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
792 | if (!sg) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
793 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
794 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
795 | if (!sg->motd) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
796 | purple_notify_error( |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
797 | gc, _("Message of the Day"), _("No Message of the Day available"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
798 | _("There is no Message of the Day associated with this connection")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
799 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
800 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
801 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
802 | tmp = g_markup_escape_text(sg->motd, -1); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
803 | purple_notify_formatted(gc, NULL, _("Message of the Day"), NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
804 | tmp, NULL, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
805 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
806 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
807 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
808 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
809 | silcpurple_create_keypair_cancel(PurpleConnection *gc, PurpleRequestFields *fields) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
810 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
811 | /* Nothing */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
812 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
813 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
814 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
815 | silcpurple_create_keypair_cb(PurpleConnection *gc, PurpleRequestFields *fields) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
816 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
817 | SilcPurple sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
818 | PurpleRequestField *f; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
819 | const char *val, *pkfile = NULL, *prfile = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
820 | const char *pass1 = NULL, *pass2 = NULL, *un = NULL, *hn = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
821 | const char *rn = NULL, *e = NULL, *o = NULL, *c = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
822 | char *identifier; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
823 | int keylen = SILCPURPLE_DEF_PKCS_LEN; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
824 | SilcPublicKey public_key; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
825 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
826 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
827 | if (!sg) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
828 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
829 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
830 | val = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
831 | f = purple_request_fields_get_field(fields, "pass1"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
832 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
833 | val = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
834 | if (val && *val) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
835 | pass1 = val; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
836 | else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
837 | pass1 = ""; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
838 | val = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
839 | f = purple_request_fields_get_field(fields, "pass2"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
840 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
841 | val = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
842 | if (val && *val) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
843 | pass2 = val; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
844 | else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
845 | pass2 = ""; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
846 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
847 | if (strcmp(pass1, pass2)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
848 | purple_notify_error( |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
849 | gc, _("Create New SILC Key Pair"), _("Passphrases do not match"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
850 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
851 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
852 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
853 | val = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
854 | f = purple_request_fields_get_field(fields, "key"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
855 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
856 | val = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
857 | if (val && *val) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
858 | keylen = atoi(val); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
859 | f = purple_request_fields_get_field(fields, "pkfile"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
860 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
861 | pkfile = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
862 | f = purple_request_fields_get_field(fields, "prfile"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
863 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
864 | prfile = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
865 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
866 | f = purple_request_fields_get_field(fields, "un"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
867 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
868 | un = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
869 | f = purple_request_fields_get_field(fields, "hn"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
870 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
871 | hn = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
872 | f = purple_request_fields_get_field(fields, "rn"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
873 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
874 | rn = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
875 | f = purple_request_fields_get_field(fields, "e"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
876 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
877 | e = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
878 | f = purple_request_fields_get_field(fields, "o"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
879 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
880 | o = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
881 | f = purple_request_fields_get_field(fields, "c"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
882 | if (f) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
883 | c = purple_request_field_string_get_value(f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
884 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
885 | identifier = silc_pkcs_encode_identifier((char *)un, (char *)hn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
886 | (char *)rn, (char *)e, (char *)o, (char *)c); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
887 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
888 | /* Create the key pair */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
889 | if (!silc_create_key_pair(SILCPURPLE_DEF_PKCS, keylen, pkfile, prfile, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
890 | identifier, pass1, NULL, &public_key, NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
891 | FALSE)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
892 | purple_notify_error( |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
893 | gc, _("Create New SILC Key Pair"), _("Key Pair Generation failed"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
894 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
895 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
896 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
897 | silcpurple_show_public_key(sg, NULL, public_key, NULL, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
898 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
899 | silc_pkcs_public_key_free(public_key); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
900 | silc_free(identifier); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
901 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
902 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
903 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
904 | silcpurple_create_keypair(PurplePluginAction *action) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
905 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
906 | PurpleConnection *gc = (PurpleConnection *) action->context; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
907 | SilcPurple sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
908 | PurpleRequestFields *fields; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
909 | PurpleRequestFieldGroup *g; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
910 | PurpleRequestField *f; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
911 | const char *username, *realname; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
912 | char *hostname, **u; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
913 | char tmp[256], pkd[256], pkd2[256], prd[256], prd2[256]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
914 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
915 | username = purple_account_get_username(sg->account); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
916 | u = g_strsplit(username, "@", 2); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
917 | username = u[0]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
918 | realname = purple_account_get_user_info(sg->account); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
919 | hostname = silc_net_localhost(); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
920 | g_snprintf(tmp, sizeof(tmp), "%s@%s", username, hostname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
921 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
922 | g_snprintf(pkd2, sizeof(pkd2), "%s" G_DIR_SEPARATOR_S"public_key.pub", silcpurple_silcdir()); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
923 | g_snprintf(prd2, sizeof(prd2), "%s" G_DIR_SEPARATOR_S"private_key.prv", silcpurple_silcdir()); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
924 | g_snprintf(pkd, sizeof(pkd) - 1, "%s", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
925 | purple_account_get_string(gc->account, "public-key", pkd2)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
926 | g_snprintf(prd, sizeof(prd) - 1, "%s", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
927 | purple_account_get_string(gc->account, "private-key", prd2)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
928 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
929 | fields = purple_request_fields_new(); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
930 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
931 | g = purple_request_field_group_new(NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
932 | f = purple_request_field_string_new("key", _("Key length"), "2048", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
933 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
934 | f = purple_request_field_string_new("pkfile", _("Public key file"), pkd, FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
935 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
936 | f = purple_request_field_string_new("prfile", _("Private key file"), prd, FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
937 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
938 | purple_request_fields_add_group(fields, g); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
939 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
940 | g = purple_request_field_group_new(NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
941 | f = purple_request_field_string_new("un", _("Username"), username ? username : "", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
942 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
943 | f = purple_request_field_string_new("hn", _("Hostname"), hostname ? hostname : "", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
944 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
945 | f = purple_request_field_string_new("rn", _("Real name"), realname ? realname : "", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
946 | purple_request_field_group_add_field(g, f); |
|
23325
a374a26fe217
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@pidgin.im>
parents:
23277
diff
changeset
|
947 | f = purple_request_field_string_new("e", _("Email"), tmp, FALSE); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
948 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
949 | f = purple_request_field_string_new("o", _("Organization"), "", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
950 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
951 | f = purple_request_field_string_new("c", _("Country"), "", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
952 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
953 | purple_request_fields_add_group(fields, g); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
954 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
955 | g = purple_request_field_group_new(NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
956 | f = purple_request_field_string_new("pass1", _("Passphrase"), "", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
957 | purple_request_field_string_set_masked(f, TRUE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
958 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
959 | f = purple_request_field_string_new("pass2", _("Passphrase (retype)"), "", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
960 | purple_request_field_string_set_masked(f, TRUE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
961 | purple_request_field_group_add_field(g, f); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
962 | purple_request_fields_add_group(fields, g); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
963 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
964 | purple_request_fields(gc, _("Create New SILC Key Pair"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
965 | _("Create New SILC Key Pair"), NULL, fields, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
966 | _("Generate Key Pair"), G_CALLBACK(silcpurple_create_keypair_cb), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
967 | _("Cancel"), G_CALLBACK(silcpurple_create_keypair_cancel), |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
968 | gc->account, NULL, NULL, gc); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
969 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
970 | g_strfreev(u); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
971 | silc_free(hostname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
972 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
973 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
974 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
975 | silcpurple_change_pass(PurplePluginAction *action) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
976 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
977 | PurpleConnection *gc = (PurpleConnection *) action->context; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
978 | purple_account_request_change_password(purple_connection_get_account(gc)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
979 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
980 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
981 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
982 | silcpurple_change_passwd(PurpleConnection *gc, const char *old, const char *new) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
983 | { |
|
22852
f6f9031e09fe
Fix for changing silc private key passphrase to or from the empty string,
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22363
diff
changeset
|
984 | char prd[256]; |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
985 | g_snprintf(prd, sizeof(prd), "%s" G_DIR_SEPARATOR_S "private_key.pub", silcpurple_silcdir()); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
986 | silc_change_private_key_passphrase(purple_account_get_string(gc->account, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
987 | "private-key", |
|
22852
f6f9031e09fe
Fix for changing silc private key passphrase to or from the empty string,
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22363
diff
changeset
|
988 | prd), old ? old : "", new ? new : ""); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
989 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
990 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
991 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
992 | silcpurple_show_set_info(PurplePluginAction *action) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
993 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
994 | PurpleConnection *gc = (PurpleConnection *) action->context; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
995 | purple_account_request_change_user_info(purple_connection_get_account(gc)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
996 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
997 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
998 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
999 | silcpurple_set_info(PurpleConnection *gc, const char *text) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1000 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1001 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1002 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1003 | static GList * |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1004 | silcpurple_actions(PurplePlugin *plugin, gpointer context) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1005 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1006 | GList *list = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1007 | PurplePluginAction *act; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1008 | |
|
17677
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
1009 | act = purple_plugin_action_new(_("Online Status"), |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
1010 | silcpurple_attrs); |
|
c1ef813bddcf
Remove the following SILC account options, as suggested by Pekka Riikonen
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17674
diff
changeset
|
1011 | list = g_list_append(list, act); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1012 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1013 | act = purple_plugin_action_new(_("Detach From Server"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1014 | silcpurple_detach); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1015 | list = g_list_append(list, act); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1016 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1017 | act = purple_plugin_action_new(_("View Message of the Day"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1018 | silcpurple_view_motd); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1019 | list = g_list_append(list, act); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1020 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1021 | act = purple_plugin_action_new(_("Create SILC Key Pair..."), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1022 | silcpurple_create_keypair); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1023 | list = g_list_append(list, act); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1024 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1025 | act = purple_plugin_action_new(_("Change Password..."), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1026 | silcpurple_change_pass); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1027 | list = g_list_append(list, act); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1028 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1029 | act = purple_plugin_action_new(_("Set User Info..."), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1030 | silcpurple_show_set_info); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1031 | list = g_list_append(list, act); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1032 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1033 | return list; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1034 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1035 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1036 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1037 | /******************************* IM Routines *********************************/ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1038 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1039 | typedef struct { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1040 | char *nick; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1041 | char *message; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1042 | SilcUInt32 message_len; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1043 | SilcMessageFlags flags; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1044 | PurpleMessageFlags gflags; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1045 | } *SilcPurpleIM; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1046 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1047 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1048 | silcpurple_send_im_resolved(SilcClient client, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1049 | SilcClientConnection conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1050 | SilcClientEntry *clients, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1051 | SilcUInt32 clients_count, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1052 | void *context) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1053 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1054 | PurpleConnection *gc = client->application; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1055 | SilcPurple sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1056 | SilcPurpleIM im = context; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1057 | PurpleConversation *convo; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1058 | char tmp[256], *nickname = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1059 | SilcClientEntry client_entry; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1060 | #ifdef HAVE_SILCMIME_H |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1061 | SilcDList list; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1062 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1063 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1064 | convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, im->nick, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1065 | sg->account); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1066 | if (!convo) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1067 | return; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1068 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1069 | if (!clients) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1070 | goto err; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1071 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1072 | if (clients_count > 1) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1073 | silc_parse_userfqdn(im->nick, &nickname, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1074 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1075 | /* Find the correct one. The im->nick might be a formatted nick |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1076 | so this will find the correct one. */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1077 | clients = silc_client_get_clients_local(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1078 | nickname, im->nick, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1079 | &clients_count); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1080 | if (!clients) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1081 | goto err; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1082 | client_entry = clients[0]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1083 | silc_free(clients); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1084 | } else { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1085 | client_entry = clients[0]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1086 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1087 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1088 | #ifdef HAVE_SILCMIME_H |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1089 | /* Check for images */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1090 | if (im->gflags & PURPLE_MESSAGE_IMAGES) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1091 | list = silcpurple_image_message(im->message, (SilcUInt32 *)&im->flags); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1092 | if (list) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1093 | /* Send one or more MIME message. If more than one, they |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1094 | are MIME fragments due to over large message */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1095 | SilcBuffer buf; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1096 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1097 | silc_dlist_start(list); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1098 | while ((buf = silc_dlist_get(list)) != SILC_LIST_END) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1099 | silc_client_send_private_message(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1100 | client_entry, im->flags, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1101 | buf->data, buf->len, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1102 | TRUE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1103 | silc_mime_partial_free(list); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1104 | purple_conv_im_write(PURPLE_CONV_IM(convo), conn->local_entry->nickname, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1105 | im->message, 0, time(NULL)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1106 | goto out; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1107 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1108 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1109 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1110 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1111 | /* Send the message */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1112 | silc_client_send_private_message(client, conn, client_entry, im->flags, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1113 | (unsigned char *)im->message, im->message_len, TRUE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1114 | purple_conv_im_write(PURPLE_CONV_IM(convo), conn->local_entry->nickname, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1115 | im->message, 0, time(NULL)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1116 | goto out; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1117 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1118 | err: |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1119 | g_snprintf(tmp, sizeof(tmp), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1120 | _("User <I>%s</I> is not present in the network"), im->nick); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1121 | purple_conversation_write(convo, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1122 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1123 | out: |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1124 | g_free(im->nick); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1125 | g_free(im->message); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1126 | silc_free(im); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1127 | silc_free(nickname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1128 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1129 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1130 | static int |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1131 | silcpurple_send_im(PurpleConnection *gc, const char *who, const char *message, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1132 | PurpleMessageFlags flags) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1133 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1134 | SilcPurple sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1135 | SilcClient client = sg->client; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1136 | SilcClientConnection conn = sg->conn; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1137 | SilcClientEntry *clients; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1138 | SilcUInt32 clients_count, mflags; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1139 | char *nickname, *msg, *tmp; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1140 | int ret = 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1141 | gboolean sign = purple_account_get_bool(sg->account, "sign-verify", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1142 | #ifdef HAVE_SILCMIME_H |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1143 | SilcDList list; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1144 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1145 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1146 | if (!who || !message) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1147 | return 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1148 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1149 | mflags = SILC_MESSAGE_FLAG_UTF8; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1150 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1151 | tmp = msg = purple_unescape_html(message); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1152 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1153 | if (!g_ascii_strncasecmp(msg, "/me ", 4)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1154 | msg += 4; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1155 | if (!*msg) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1156 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1157 | return 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1158 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1159 | mflags |= SILC_MESSAGE_FLAG_ACTION; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1160 | } else if (strlen(msg) > 1 && msg[0] == '/') { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1161 | if (!silc_client_command_call(client, conn, msg + 1)) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1162 | purple_notify_error(gc, _("Call Command"), _("Cannot call command"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1163 | _("Unknown command")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1164 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1165 | return 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1166 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1167 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1168 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1169 | if (!silc_parse_userfqdn(who, &nickname, NULL)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1170 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1171 | return 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1172 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1173 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1174 | if (sign) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1175 | mflags |= SILC_MESSAGE_FLAG_SIGNED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1176 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1177 | /* Find client entry */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1178 | clients = silc_client_get_clients_local(client, conn, nickname, who, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1179 | &clients_count); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1180 | if (!clients) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1181 | /* Resolve unknown user */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1182 | SilcPurpleIM im = silc_calloc(1, sizeof(*im)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1183 | if (!im) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1184 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1185 | return 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1186 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1187 | im->nick = g_strdup(who); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1188 | im->message = g_strdup(message); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1189 | im->message_len = strlen(im->message); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1190 | im->flags = mflags; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1191 | im->gflags = flags; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1192 | silc_client_get_clients(client, conn, nickname, NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1193 | silcpurple_send_im_resolved, im); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1194 | silc_free(nickname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1195 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1196 | return 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1197 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1198 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1199 | #ifdef HAVE_SILCMIME_H |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1200 | /* Check for images */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1201 | if (flags & PURPLE_MESSAGE_IMAGES) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1202 | list = silcpurple_image_message(message, &mflags); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1203 | if (list) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1204 | /* Send one or more MIME message. If more than one, they |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1205 | are MIME fragments due to over large message */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1206 | SilcBuffer buf; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1207 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1208 | silc_dlist_start(list); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1209 | while ((buf = silc_dlist_get(list)) != SILC_LIST_END) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1210 | ret = |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1211 | silc_client_send_private_message(client, conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1212 | clients[0], mflags, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1213 | buf->data, buf->len, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1214 | TRUE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1215 | silc_mime_partial_free(list); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1216 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1217 | silc_free(nickname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1218 | silc_free(clients); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1219 | return ret; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1220 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1221 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1222 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1223 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1224 | /* Send private message directly */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1225 | ret = silc_client_send_private_message(client, conn, clients[0], |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1226 | mflags, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1227 | (unsigned char *)msg, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1228 | strlen(msg), TRUE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1229 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1230 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1231 | silc_free(nickname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1232 | silc_free(clients); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1233 | return ret; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1234 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1235 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1236 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1237 | static GList *silcpurple_blist_node_menu(PurpleBlistNode *node) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1238 | /* split this single menu building function back into the two |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1239 | original: one for buddies and one for chats */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1240 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1241 | if(PURPLE_BLIST_NODE_IS_CHAT(node)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1242 | return silcpurple_chat_menu((PurpleChat *) node); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1243 | } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1244 | return silcpurple_buddy_menu((PurpleBuddy *) node); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1245 | } else { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1246 | g_return_val_if_reached(NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1247 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1248 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1249 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1250 | /********************************* Commands **********************************/ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1251 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1252 | static PurpleCmdRet silcpurple_cmd_chat_part(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1253 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1254 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1255 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1256 | PurpleConversation *convo = conv; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1257 | int id = 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1258 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1259 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1260 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1261 | if (gc == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1262 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1263 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1264 | if(args && args[0]) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1265 | convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, args[0], |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1266 | gc->account); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1267 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1268 | if (convo != NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1269 | id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(convo)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1270 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1271 | if (id == 0) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1272 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1273 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1274 | silcpurple_chat_leave(gc, id); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1275 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1276 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1277 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1278 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1279 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1280 | static PurpleCmdRet silcpurple_cmd_chat_topic(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1281 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1282 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1283 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1284 | int id = 0; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1285 | char *buf, *tmp, *tmp2; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1286 | const char *topic; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1287 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1288 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1289 | id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1290 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1291 | if (gc == NULL || id == 0) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1292 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1293 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1294 | if (!args || !args[0]) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1295 | topic = purple_conv_chat_get_topic (PURPLE_CONV_CHAT(conv)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1296 | if (topic) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1297 | tmp = g_markup_escape_text(topic, -1); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1298 | tmp2 = purple_markup_linkify(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1299 | buf = g_strdup_printf(_("current topic is: %s"), tmp2); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1300 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1301 | g_free(tmp2); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1302 | } else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1303 | buf = g_strdup(_("No topic is set")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1304 | purple_conv_chat_write(PURPLE_CONV_CHAT(conv), gc->account->username, buf, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1305 | PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1306 | g_free(buf); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1307 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1308 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1309 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1310 | if (args && args[0] && (strlen(args[0]) > 255)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1311 | *error = g_strdup(_("Topic too long")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1312 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1313 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1314 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1315 | silcpurple_chat_set_topic(gc, id, args ? args[0] : NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1316 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1317 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1318 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1319 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1320 | static PurpleCmdRet silcpurple_cmd_chat_join(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1321 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1322 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1323 | GHashTable *comp; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1324 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1325 | if(!args || !args[0]) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1326 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1327 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1328 | comp = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1329 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1330 | g_hash_table_replace(comp, "channel", args[0]); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1331 | if(args[1]) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1332 | g_hash_table_replace(comp, "passphrase", args[1]); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1333 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1334 | silcpurple_chat_join(purple_conversation_get_gc(conv), comp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1335 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1336 | g_hash_table_destroy(comp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1337 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1338 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1339 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1340 | static PurpleCmdRet silcpurple_cmd_chat_list(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1341 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1342 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1343 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1344 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1345 | purple_roomlist_show_with_account(purple_connection_get_account(gc)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1346 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1347 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1348 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1349 | static PurpleCmdRet silcpurple_cmd_whois(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1350 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1351 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1352 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1353 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1354 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1355 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1356 | if (gc == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1357 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1358 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1359 | silcpurple_get_info(gc, args[0]); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1360 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1361 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1362 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1363 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1364 | static PurpleCmdRet silcpurple_cmd_msg(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1365 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1366 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1367 | int ret; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1368 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1369 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1370 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1371 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1372 | if (gc == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1373 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1374 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1375 | ret = silcpurple_send_im(gc, args[0], args[1], PURPLE_MESSAGE_SEND); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1376 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1377 | if (ret) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1378 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1379 | else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1380 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1381 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1382 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1383 | static PurpleCmdRet silcpurple_cmd_query(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1384 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1385 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1386 | int ret = 1; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1387 | PurpleConversation *convo; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1388 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1389 | PurpleAccount *account; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1390 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1391 | if (!args || !args[0]) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1392 | *error = g_strdup(_("You must specify a nick")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1393 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1394 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1395 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1396 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1397 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1398 | if (gc == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1399 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1400 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1401 | account = purple_connection_get_account(gc); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1402 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1403 | convo = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, args[0]); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1404 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1405 | if (args[1]) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1406 | ret = silcpurple_send_im(gc, args[0], args[1], PURPLE_MESSAGE_SEND); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1407 | purple_conv_im_write(PURPLE_CONV_IM(convo), purple_connection_get_display_name(gc), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1408 | args[1], PURPLE_MESSAGE_SEND, time(NULL)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1409 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1410 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1411 | if (ret) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1412 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1413 | else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1414 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1415 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1416 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1417 | static PurpleCmdRet silcpurple_cmd_motd(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1418 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1419 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1420 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1421 | SilcPurple sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1422 | char *tmp; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1423 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1424 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1425 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1426 | if (gc == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1427 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1428 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1429 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1430 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1431 | if (sg == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1432 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1433 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1434 | if (!sg->motd) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1435 | *error = g_strdup(_("There is no Message of the Day associated with this connection")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1436 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1437 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1438 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1439 | tmp = g_markup_escape_text(sg->motd, -1); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1440 | purple_notify_formatted(gc, NULL, _("Message of the Day"), NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1441 | tmp, NULL, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1442 | g_free(tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1443 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1444 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1445 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1446 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1447 | static PurpleCmdRet silcpurple_cmd_detach(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1448 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1449 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1450 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1451 | SilcPurple sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1452 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1453 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1454 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1455 | if (gc == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1456 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1457 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1458 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1459 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1460 | if (sg == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1461 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1462 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1463 | silc_client_command_call(sg->client, sg->conn, "DETACH"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1464 | sg->detaching = TRUE; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1465 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1466 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1467 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1468 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1469 | static PurpleCmdRet silcpurple_cmd_cmode(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1470 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1471 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1472 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1473 | SilcPurple sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1474 | SilcChannelEntry channel; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1475 | char *silccmd, *silcargs, *msg, tmp[256]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1476 | const char *chname; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1477 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1478 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1479 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1480 | if (gc == NULL || !args || gc->proto_data == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1481 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1482 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1483 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1484 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1485 | if (args[0]) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1486 | chname = args[0]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1487 | else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1488 | chname = purple_conversation_get_name(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1489 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1490 | if (!args[1]) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1491 | channel = silc_client_get_channel(sg->client, sg->conn, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1492 | (char *)chname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1493 | if (!channel) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1494 | *error = g_strdup_printf(_("channel %s not found"), chname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1495 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1496 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1497 | if (channel->mode) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1498 | silcpurple_get_chmode_string(channel->mode, tmp, sizeof(tmp)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1499 | msg = g_strdup_printf(_("channel modes for %s: %s"), chname, tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1500 | } else { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1501 | msg = g_strdup_printf(_("no channel modes are set on %s"), chname); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1502 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1503 | purple_conv_chat_write(PURPLE_CONV_CHAT(conv), "", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1504 | msg, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL)); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1505 | g_free(msg); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1506 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1507 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1508 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1509 | silcargs = g_strjoinv(" ", args); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1510 | silccmd = g_strconcat(cmd, " ", args ? silcargs : NULL, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1511 | g_free(silcargs); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1512 | if (!silc_client_command_call(sg->client, sg->conn, silccmd)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1513 | g_free(silccmd); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1514 | *error = g_strdup_printf(_("Failed to set cmodes for %s"), args[0]); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1515 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1516 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1517 | g_free(silccmd); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1518 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1519 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1520 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1521 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1522 | static PurpleCmdRet silcpurple_cmd_generic(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1523 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1524 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1525 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1526 | SilcPurple sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1527 | char *silccmd, *silcargs; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1528 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1529 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1530 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1531 | if (gc == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1532 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1533 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1534 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1535 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1536 | if (sg == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1537 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1538 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1539 | silcargs = g_strjoinv(" ", args); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1540 | silccmd = g_strconcat(cmd, " ", args ? silcargs : NULL, NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1541 | g_free(silcargs); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1542 | if (!silc_client_command_call(sg->client, sg->conn, silccmd)) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1543 | g_free(silccmd); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1544 | *error = g_strdup_printf(_("Unknown command: %s, (may be a client bug)"), cmd); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1545 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1546 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1547 | g_free(silccmd); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1548 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1549 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1550 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1551 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1552 | static PurpleCmdRet silcpurple_cmd_quit(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1553 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1554 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1555 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1556 | SilcPurple sg; |
|
23545
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1557 | GHashTable *ui_info; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1558 | const char *ui_name = NULL, *ui_website = NULL; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1559 | char *quit_msg; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1560 | |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1561 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1562 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1563 | if (gc == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1564 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1565 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1566 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1567 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1568 | if (sg == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1569 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1570 | |
|
23545
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1571 | ui_info = purple_core_get_ui_info(); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1572 | |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1573 | if(ui_info) { |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1574 | ui_name = g_hash_table_lookup(ui_info, "name"); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1575 | ui_website = g_hash_table_lookup(ui_info, "website"); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1576 | } |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1577 | |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1578 | if(!ui_name || !ui_website) { |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1579 | ui_name = "Pidgin"; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1580 | ui_website = PURPLE_WEBSITE; |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1581 | } |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1582 | quit_msg = g_strdup_printf(_("Download %s: %s"), |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1583 | ui_name, ui_website); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1584 | |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1585 | silc_client_command_call(sg->client, sg->conn, NULL, |
|
23545
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1586 | "QUIT", (args && args[0]) ? args[0] : quit_msg, NULL); |
|
676b13ddfd2c
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evands@pidgin.im>
parents:
23542
diff
changeset
|
1587 | g_free(quit_msg); |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1588 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1589 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1590 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1591 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1592 | static PurpleCmdRet silcpurple_cmd_call(PurpleConversation *conv, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1593 | const char *cmd, char **args, char **error, void *data) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1594 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1595 | PurpleConnection *gc; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1596 | SilcPurple sg; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1597 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1598 | gc = purple_conversation_get_gc(conv); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1599 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1600 | if (gc == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1601 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1602 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1603 | sg = gc->proto_data; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1604 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1605 | if (sg == NULL) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1606 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1607 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1608 | if (!silc_client_command_call(sg->client, sg->conn, args[0])) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1609 | *error = g_strdup_printf(_("Unknown command: %s"), args[0]); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1610 | return PURPLE_CMD_RET_FAILED; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1611 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1612 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1613 | return PURPLE_CMD_RET_OK; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1614 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1615 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1616 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1617 | /************************** Plugin Initialization ****************************/ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1618 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1619 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1620 | silcpurple_register_commands(void) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1621 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1622 | purple_cmd_register("part", "w", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1623 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1624 | PURPLE_CMD_FLAG_PRPL_ONLY | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1625 | "prpl-silc", silcpurple_cmd_chat_part, _("part [channel]: Leave the chat"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1626 | purple_cmd_register("leave", "w", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1627 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1628 | PURPLE_CMD_FLAG_PRPL_ONLY | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1629 | "prpl-silc", silcpurple_cmd_chat_part, _("leave [channel]: Leave the chat"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1630 | purple_cmd_register("topic", "s", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1631 | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1632 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1633 | silcpurple_cmd_chat_topic, _("topic [<new topic>]: View or change the topic"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1634 | purple_cmd_register("join", "ws", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1635 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1636 | PURPLE_CMD_FLAG_PRPL_ONLY | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1637 | "prpl-silc", silcpurple_cmd_chat_join, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1638 | _("join <channel> [<password>]: Join a chat on this network"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1639 | purple_cmd_register("list", "", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1640 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1641 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1642 | silcpurple_cmd_chat_list, _("list: List channels on this network"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1643 | purple_cmd_register("whois", "w", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1644 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1645 | "prpl-silc", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1646 | silcpurple_cmd_whois, _("whois <nick>: View nick's information"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1647 | purple_cmd_register("msg", "ws", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1648 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1649 | "prpl-silc", silcpurple_cmd_msg, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1650 | _("msg <nick> <message>: Send a private message to a user"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1651 | purple_cmd_register("query", "ws", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1652 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1653 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_query, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1654 | _("query <nick> [<message>]: Send a private message to a user"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1655 | purple_cmd_register("motd", "", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1656 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1657 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_motd, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1658 | _("motd: View the server's Message Of The Day"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1659 | purple_cmd_register("detach", "", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1660 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1661 | "prpl-silc", silcpurple_cmd_detach, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1662 | _("detach: Detach this session"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1663 | purple_cmd_register("quit", "s", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1664 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1665 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_quit, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1666 | _("quit [message]: Disconnect from the server, with an optional message"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1667 | purple_cmd_register("call", "s", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1668 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1669 | "prpl-silc", silcpurple_cmd_call, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1670 | _("call <command>: Call any silc client command"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1671 | /* These below just get passed through for the silc client library to deal |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1672 | * with */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1673 | purple_cmd_register("kill", "ws", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1674 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1675 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1676 | _("kill <nick> [-pubkey|<reason>]: Kill nick"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1677 | purple_cmd_register("nick", "w", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1678 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1679 | "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1680 | _("nick <newnick>: Change your nickname"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1681 | purple_cmd_register("whowas", "ww", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1682 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1683 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1684 | _("whowas <nick>: View nick's information"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1685 | purple_cmd_register("cmode", "wws", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1686 | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1687 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_cmode, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1688 | _("cmode <channel> [+|-<modes>] [arguments]: Change or display channel modes"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1689 | purple_cmd_register("cumode", "wws", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1690 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1691 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1692 | _("cumode <channel> +|-<modes> <nick>: Change nick's modes on channel"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1693 | purple_cmd_register("umode", "w", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1694 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1695 | "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1696 | _("umode <usermodes>: Set your modes in the network"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1697 | purple_cmd_register("oper", "s", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1698 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1699 | "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1700 | _("oper <nick> [-pubkey]: Get server operator privileges"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1701 | purple_cmd_register("invite", "ws", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1702 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1703 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1704 | _("invite <channel> [-|+]<nick>: invite nick or add/remove from channel invite list"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1705 | purple_cmd_register("kick", "wws", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1706 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1707 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1708 | _("kick <channel> <nick> [comment]: Kick client from channel"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1709 | purple_cmd_register("info", "w", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1710 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1711 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1712 | _("info [server]: View server administrative details"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1713 | purple_cmd_register("ban", "ww", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1714 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1715 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1716 | _("ban [<channel> +|-<nick>]: Ban client from channel"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1717 | purple_cmd_register("getkey", "w", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1718 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1719 | "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1720 | _("getkey <nick|server>: Retrieve client's or server's public key"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1721 | purple_cmd_register("stats", "", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1722 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1723 | "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1724 | _("stats: View server and network statistics"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1725 | purple_cmd_register("ping", "", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1726 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1727 | "prpl-silc", silcpurple_cmd_generic, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1728 | _("ping: Send PING to the connected server"), NULL); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1729 | #if 0 /* Purple doesn't handle these yet */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1730 | purple_cmd_register("users", "w", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1731 | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1732 | "prpl-silc", silcpurple_cmd_users, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1733 | _("users <channel>: List users in channel")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1734 | purple_cmd_register("names", "ww", PURPLE_CMD_P_PRPL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1735 | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1736 | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_names, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1737 | _("names [-count|-ops|-halfops|-voices|-normal] <channel(s)>: List specific users in channel(s)")); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1738 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1739 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1740 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1741 | static PurpleWhiteboardPrplOps silcpurple_wb_ops = |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1742 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1743 | silcpurple_wb_start, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1744 | silcpurple_wb_end, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1745 | silcpurple_wb_get_dimensions, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1746 | silcpurple_wb_set_dimensions, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1747 | silcpurple_wb_get_brush, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1748 | silcpurple_wb_set_brush, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1749 | silcpurple_wb_send, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1750 | silcpurple_wb_clear, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1751 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1752 | /* padding */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1753 | NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1754 | NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1755 | NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1756 | NULL |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1757 | }; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1758 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1759 | static PurplePluginProtocolInfo prpl_info = |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1760 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1761 | #ifdef HAVE_SILCMIME_H |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1762 | OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | |
|
18143
4079b7c5ef7b
Add OPT_PROTO_SLASH_COMMANDS_NATIVE support to silc10
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17677
diff
changeset
|
1763 | OPT_PROTO_PASSWORD_OPTIONAL | OPT_PROTO_IM_IMAGE | |
|
4079b7c5ef7b
Add OPT_PROTO_SLASH_COMMANDS_NATIVE support to silc10
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17677
diff
changeset
|
1764 | OPT_PROTO_SLASH_COMMANDS_NATIVE, |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1765 | #else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1766 | OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | |
|
18143
4079b7c5ef7b
Add OPT_PROTO_SLASH_COMMANDS_NATIVE support to silc10
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17677
diff
changeset
|
1767 | OPT_PROTO_PASSWORD_OPTIONAL | |
|
4079b7c5ef7b
Add OPT_PROTO_SLASH_COMMANDS_NATIVE support to silc10
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17677
diff
changeset
|
1768 | OPT_PROTO_SLASH_COMMANDS_NATIVE, |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1769 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1770 | NULL, /* user_splits */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1771 | NULL, /* protocol_options */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1772 | #ifdef SILC_ATTRIBUTE_USER_ICON |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1773 | {"jpeg,gif,png,bmp", 0, 0, 96, 96, 0, PURPLE_ICON_SCALE_DISPLAY}, /* icon_spec */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1774 | #else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1775 | NO_BUDDY_ICONS, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1776 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1777 | silcpurple_list_icon, /* list_icon */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1778 | NULL, /* list_emblems */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1779 | silcpurple_status_text, /* status_text */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1780 | silcpurple_tooltip_text, /* tooltip_text */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1781 | silcpurple_away_states, /* away_states */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1782 | silcpurple_blist_node_menu, /* blist_node_menu */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1783 | silcpurple_chat_info, /* chat_info */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1784 | silcpurple_chat_info_defaults,/* chat_info_defaults */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1785 | silcpurple_login, /* login */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1786 | silcpurple_close, /* close */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1787 | silcpurple_send_im, /* send_im */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1788 | silcpurple_set_info, /* set_info */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1789 | NULL, /* send_typing */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1790 | silcpurple_get_info, /* get_info */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1791 | silcpurple_set_status, /* set_status */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1792 | silcpurple_idle_set, /* set_idle */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1793 | silcpurple_change_passwd, /* change_passwd */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1794 | silcpurple_add_buddy, /* add_buddy */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1795 | NULL, /* add_buddies */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1796 | silcpurple_remove_buddy, /* remove_buddy */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1797 | NULL, /* remove_buddies */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1798 | NULL, /* add_permit */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1799 | NULL, /* add_deny */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1800 | NULL, /* rem_permit */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1801 | NULL, /* rem_deny */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1802 | NULL, /* set_permit_deny */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1803 | silcpurple_chat_join, /* join_chat */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1804 | NULL, /* reject_chat */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1805 | silcpurple_get_chat_name, /* get_chat_name */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1806 | silcpurple_chat_invite, /* chat_invite */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1807 | silcpurple_chat_leave, /* chat_leave */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1808 | NULL, /* chat_whisper */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1809 | silcpurple_chat_send, /* chat_send */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1810 | silcpurple_keepalive, /* keepalive */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1811 | NULL, /* register_user */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1812 | NULL, /* get_cb_info */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1813 | NULL, /* get_cb_away */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1814 | NULL, /* alias_buddy */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1815 | NULL, /* group_buddy */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1816 | NULL, /* rename_group */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1817 | NULL, /* buddy_free */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1818 | NULL, /* convo_closed */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1819 | NULL, /* normalize */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1820 | #ifdef SILC_ATTRIBUTE_USER_ICON |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1821 | silcpurple_buddy_set_icon, /* set_buddy_icon */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1822 | #else |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1823 | NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1824 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1825 | NULL, /* remove_group */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1826 | NULL, /* get_cb_real_name */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1827 | silcpurple_chat_set_topic, /* set_chat_topic */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1828 | NULL, /* find_blist_chat */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1829 | silcpurple_roomlist_get_list, /* roomlist_get_list */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1830 | silcpurple_roomlist_cancel, /* roomlist_cancel */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1831 | NULL, /* roomlist_expand_category */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1832 | NULL, /* can_receive_file */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1833 | silcpurple_ftp_send_file, /* send_file */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1834 | silcpurple_ftp_new_xfer, /* new_xfer */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1835 | NULL, /* offline_message */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1836 | &silcpurple_wb_ops, /* whiteboard_prpl_ops */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1837 | NULL, /* send_raw */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1838 | NULL, /* roomlist_room_serialize */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1839 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1840 | NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1841 | NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1842 | NULL, |
|
23276
f4944cfaa1ff
Use up the last padding for PurplePluginProtocolInfo in a way that allows
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22852
diff
changeset
|
1843 | sizeof(PurplePluginProtocolInfo), /* struct_size */ |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23276
diff
changeset
|
1844 | NULL |
|
17674
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1845 | }; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1846 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1847 | static PurplePluginInfo info = |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1848 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1849 | PURPLE_PLUGIN_MAGIC, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1850 | PURPLE_MAJOR_VERSION, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1851 | PURPLE_MINOR_VERSION, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1852 | PURPLE_PLUGIN_PROTOCOL, /**< type */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1853 | NULL, /**< ui_requirement */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1854 | 0, /**< flags */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1855 | NULL, /**< dependencies */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1856 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1857 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1858 | "prpl-silc", /**< id */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1859 | "SILC", /**< name */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1860 | "1.0", /**< version */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1861 | /** summary */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1862 | N_("SILC Protocol Plugin"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1863 | /** description */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1864 | N_("Secure Internet Live Conferencing (SILC) Protocol"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1865 | "Pekka Riikonen", /**< author */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1866 | "http://silcnet.org/", /**< homepage */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1867 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1868 | NULL, /**< load */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1869 | NULL, /**< unload */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1870 | NULL, /**< destroy */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1871 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1872 | NULL, /**< ui_info */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1873 | &prpl_info, /**< extra_info */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1874 | NULL, /**< prefs_info */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1875 | silcpurple_actions, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1876 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1877 | /* padding */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1878 | NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1879 | NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1880 | NULL, |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1881 | NULL |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1882 | }; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1883 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1884 | static void |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1885 | init_plugin(PurplePlugin *plugin) |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1886 | { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1887 | PurpleAccountOption *option; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1888 | PurpleAccountUserSplit *split; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1889 | char tmp[256]; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1890 | int i; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1891 | PurpleKeyValuePair *kvp; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1892 | GList *list = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1893 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1894 | silc_plugin = plugin; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1895 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1896 | split = purple_account_user_split_new(_("Network"), "silcnet.org", '@'); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1897 | prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1898 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1899 | /* Account options */ |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1900 | option = purple_account_option_string_new(_("Connect server"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1901 | "server", |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1902 | "silc.silcnet.org"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1903 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1904 | option = purple_account_option_int_new(_("Port"), "port", 706); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1905 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1906 | g_snprintf(tmp, sizeof(tmp), "%s" G_DIR_SEPARATOR_S "public_key.pub", silcpurple_silcdir()); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1907 | option = purple_account_option_string_new(_("Public Key file"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1908 | "public-key", tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1909 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1910 | g_snprintf(tmp, sizeof(tmp), "%s" G_DIR_SEPARATOR_S "private_key.prv", silcpurple_silcdir()); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1911 | option = purple_account_option_string_new(_("Private Key file"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1912 | "private-key", tmp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1913 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1914 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1915 | for (i = 0; silc_default_ciphers[i].name; i++) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1916 | kvp = g_new0(PurpleKeyValuePair, 1); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1917 | kvp->key = g_strdup(silc_default_ciphers[i].name); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1918 | kvp->value = g_strdup(silc_default_ciphers[i].name); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1919 | list = g_list_append(list, kvp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1920 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1921 | option = purple_account_option_list_new(_("Cipher"), "cipher", list); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1922 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1923 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1924 | list = NULL; |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1925 | for (i = 0; silc_default_hmacs[i].name; i++) { |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1926 | kvp = g_new0(PurpleKeyValuePair, 1); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1927 | kvp->key = g_strdup(silc_default_hmacs[i].name); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1928 | kvp->value = g_strdup(silc_default_hmacs[i].name); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1929 | list = g_list_append(list, kvp); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1930 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1931 | option = purple_account_option_list_new(_("HMAC"), "hmac", list); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1932 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1933 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1934 | option = purple_account_option_bool_new(_("Public key authentication"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1935 | "pubkey-auth", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1936 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1937 | option = purple_account_option_bool_new(_("Block IMs without Key Exchange"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1938 | "block-ims", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1939 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1940 | option = purple_account_option_bool_new(_("Block messages to whiteboard"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1941 | "block-wb", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1942 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1943 | option = purple_account_option_bool_new(_("Automatically open whiteboard"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1944 | "open-wb", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1945 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1946 | option = purple_account_option_bool_new(_("Digitally sign and verify all messages"), |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1947 | "sign-verify", FALSE); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1948 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1949 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1950 | purple_prefs_remove("/plugins/prpl/silc"); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1951 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1952 | silcpurple_register_commands(); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1953 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1954 | #ifdef _WIN32 |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1955 | silc_net_win32_init(); |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1956 | #endif |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1957 | } |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1958 | |
|
aafdd7bed36d
Duplicate the current SILC prpl as silc10 for backwards compatibility with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1959 | PURPLE_INIT_PLUGIN(silc, init_plugin, info); |