Wed, 21 Apr 2021 18:45:53 -0500
Migrate gg, novel, null, sametime, silc, and zephyr to using G_DECLARE_FINAL_TYPE for their protocol objects
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/620/
| 8849 | 1 | /* |
| 2 | ||
| 15884 | 3 | silcpurple.h |
| 8849 | 4 | |
| 5 | Author: Pekka Riikonen <priikone@silcnet.org> | |
| 6 | ||
|
17675
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
7 | Copyright (C) 2004 - 2007 Pekka Riikonen |
| 8849 | 8 | |
| 9 | This program is free software; you can redistribute it and/or modify | |
| 10 | it under the terms of the GNU General Public License as published by | |
| 11 | the Free Software Foundation; version 2 of the License. | |
| 12 | ||
| 13 | This program is distributed in the hope that it will be useful, | |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | GNU General Public License for more details. | |
| 17 | ||
| 18 | */ | |
| 19 | ||
|
39819
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
20 | #ifndef PURPLE_SILC_SILCPURPLE_H |
|
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
21 | #define PURPLE_SILC_SILCPURPLE_H |
| 8849 | 22 | |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
23 | #include <silc.h> |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
24 | #include <silcclient.h> |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
25 | |
| 15884 | 26 | /* Purple includes */ |
|
40358
e6fe6fc1f516
move all protocols, purple plugins, and purple tests to use purple.h instead of including files individually
Gary Kramlich <grim@reaperworld.com>
parents:
40115
diff
changeset
|
27 | #include <purple.h> |
| 8849 | 28 | |
|
40865
82e45cd837fa
Migrate gg, novel, null, sametime, silc, and zephyr to using G_DECLARE_FINAL_TYPE for their protocol objects
Gary Kramlich <grim@reaperworld.com>
parents:
40769
diff
changeset
|
29 | #define SILCPURPLE_TYPE_PROTOCOL (silcpurple_protocol_get_type()) |
|
82e45cd837fa
Migrate gg, novel, null, sametime, silc, and zephyr to using G_DECLARE_FINAL_TYPE for their protocol objects
Gary Kramlich <grim@reaperworld.com>
parents:
40769
diff
changeset
|
30 | G_DECLARE_FINAL_TYPE(SilcProtocol, silcpurple_protocol, SILC, PROTOCOL, |
|
82e45cd837fa
Migrate gg, novel, null, sametime, silc, and zephyr to using G_DECLARE_FINAL_TYPE for their protocol objects
Gary Kramlich <grim@reaperworld.com>
parents:
40769
diff
changeset
|
31 | PurpleProtocol) |
|
36595
d013a99e6d94
Refactored silc to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
32 | |
| 8849 | 33 | /* Default public and private key file names */ |
| 15884 | 34 | #define SILCPURPLE_PUBLIC_KEY_NAME "public_key.pub" |
| 35 | #define SILCPURPLE_PRIVATE_KEY_NAME "private_key.prv" | |
| 8849 | 36 | |
| 37 | /* Default settings for creating key pair */ | |
| 15884 | 38 | #define SILCPURPLE_DEF_PKCS "rsa" |
| 39 | #define SILCPURPLE_DEF_PKCS_LEN 2048 | |
| 8849 | 40 | |
| 15884 | 41 | #define SILCPURPLE_PRVGRP 0x001fffff |
| 8849 | 42 | |
|
10050
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
43 | /* Status IDs */ |
| 15884 | 44 | #define SILCPURPLE_STATUS_ID_OFFLINE "offline" |
| 45 | #define SILCPURPLE_STATUS_ID_AVAILABLE "available" | |
| 46 | #define SILCPURPLE_STATUS_ID_HYPER "hyper" | |
| 47 | #define SILCPURPLE_STATUS_ID_AWAY "away" | |
| 48 | #define SILCPURPLE_STATUS_ID_BUSY "busy" | |
| 49 | #define SILCPURPLE_STATUS_ID_INDISPOSED "indisposed" | |
| 50 | #define SILCPURPLE_STATUS_ID_PAGE "page" | |
|
10050
78e480f768f2
[gaim-migrate @ 11011]
Dave West <kat@users.sourceforge.net>
parents:
9917
diff
changeset
|
51 | |
| 8849 | 52 | typedef struct { |
| 53 | unsigned long id; | |
| 54 | const char *channel; | |
| 55 | unsigned long chid; | |
| 56 | const char *parentch; | |
| 57 | SilcChannelPrivateKey key; | |
| 15884 | 58 | } *SilcPurplePrvgrp; |
| 8849 | 59 | |
| 15884 | 60 | /* The SILC Purple plugin context */ |
| 61 | typedef struct SilcPurpleStruct { | |
|
40115
68872ce295a4
Convert SILC to GIO.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40113
diff
changeset
|
62 | GCancellable *cancellable; |
|
68872ce295a4
Convert SILC to GIO.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40113
diff
changeset
|
63 | GSocketConnection *sockconn; |
|
68872ce295a4
Convert SILC to GIO.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40113
diff
changeset
|
64 | |
| 8849 | 65 | SilcClient client; |
| 66 | SilcClientConnection conn; | |
|
17675
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
67 | SilcPublicKey public_key; |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
68 | SilcPrivateKey private_key; |
|
20289
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17680
diff
changeset
|
69 | SilcHash sha1hash; |
| 8849 | 70 | |
|
20289
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17680
diff
changeset
|
71 | SilcDList tasks; |
| 8849 | 72 | guint scheduler; |
| 15884 | 73 | PurpleConnection *gc; |
| 74 | PurpleAccount *account; | |
| 8849 | 75 | unsigned long channel_ids; |
| 76 | GList *grps; | |
| 77 | ||
| 78 | char *motd; | |
| 15884 | 79 | PurpleRoomlist *roomlist; |
|
12217
ea610d8ab584
[gaim-migrate @ 14519]
Pekka Riikonen <priikone@silcnet.org>
parents:
12216
diff
changeset
|
80 | SilcMimeAssembler mimeass; |
| 8849 | 81 | unsigned int detaching : 1; |
| 82 | unsigned int resuming : 1; | |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
83 | unsigned int roomlist_cancelled : 1; |
| 8849 | 84 | unsigned int chpk : 1; |
| 15884 | 85 | } *SilcPurple; |
| 8849 | 86 | |
|
17675
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
87 | void silc_say(SilcClient client, SilcClientConnection conn, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
88 | SilcClientMessageType type, char *msg, ...); |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
89 | SilcBool silcpurple_command_reply(SilcClient client, SilcClientConnection conn, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
90 | SilcCommand command, SilcStatus status, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
91 | SilcStatus error, void *context, va_list ap); |
| 15884 | 92 | gboolean silcpurple_check_silc_dir(PurpleConnection *gc); |
| 93 | const char *silcpurple_silcdir(void); | |
| 94 | const char *silcpurple_session_file(const char *account); | |
| 95 | void silcpurple_verify_public_key(SilcClient client, SilcClientConnection conn, | |
|
17675
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
96 | const char *name, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
97 | SilcConnectionType conn_type, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
98 | SilcPublicKey public_key, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
99 | SilcVerifyPublicKey completion, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
100 | void *context); |
| 15884 | 101 | GList *silcpurple_buddy_menu(PurpleBuddy *buddy); |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
102 | void silcpurple_add_buddy(PurpleProtocolServer *protocol_server, PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, const char *message); |
| 15884 | 103 | void silcpurple_send_buddylist(PurpleConnection *gc); |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
104 | void silcpurple_remove_buddy(PurpleProtocolServer *protocol_server, PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group); |
| 15884 | 105 | void silcpurple_buddy_keyagr_request(SilcClient client, |
|
17675
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
106 | SilcClientConnection conn, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
107 | SilcClientEntry client_entry, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
108 | const char *hostname, SilcUInt16 port, |
|
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
109 | SilcUInt16 protocol); |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
110 | void silcpurple_idle_set(PurpleProtocolServer *protocol_server, PurpleConnection *gc, int idle); |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
111 | void silcpurple_tooltip_text(PurpleProtocolClient *ppclient, PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full); |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
112 | char *silcpurple_status_text(PurpleProtocolClient *ppclient, PurpleBuddy *b); |
| 15884 | 113 | gboolean silcpurple_ip_is_private(const char *ip); |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
114 | void silcpurple_ftp_send_file(PurpleProtocolXfer *prplxfer, PurpleConnection *gc, const char *name, const char *file); |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
115 | PurpleXfer *silcpurple_ftp_new_xfer(PurpleProtocolXfer *prplxfer, PurpleConnection *gc, const char *name); |
| 15884 | 116 | void silcpurple_ftp_request(SilcClient client, SilcClientConnection conn, |
| 8849 | 117 | SilcClientEntry client_entry, SilcUInt32 session_id, |
| 118 | const char *hostname, SilcUInt16 port); | |
| 15884 | 119 | void silcpurple_show_public_key(SilcPurple sg, |
| 8849 | 120 | const char *name, SilcPublicKey public_key, |
| 121 | GCallback callback, void *context); | |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
122 | void silcpurple_get_info(PurpleProtocolServer *protocol_server, PurpleConnection *gc, const char *who); |
| 8849 | 123 | SilcAttributePayload |
| 15884 | 124 | silcpurple_get_attr(SilcDList attrs, SilcAttribute attribute); |
| 125 | void silcpurple_get_umode_string(SilcUInt32 mode, char *buf, | |
| 8849 | 126 | SilcUInt32 buf_size); |
| 15884 | 127 | void silcpurple_get_chmode_string(SilcUInt32 mode, char *buf, |
| 8849 | 128 | SilcUInt32 buf_size); |
| 15884 | 129 | void silcpurple_get_chumode_string(SilcUInt32 mode, char *buf, |
| 8849 | 130 | SilcUInt32 buf_size); |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
131 | GList *silcpurple_chat_info(PurpleProtocolChat *protocol_chat, PurpleConnection *gc); |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
132 | GHashTable *silcpurple_chat_info_defaults(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, const char *chat_name); |
| 15884 | 133 | GList *silcpurple_chat_menu(PurpleChat *); |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
134 | void silcpurple_chat_join(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, GHashTable *data); |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
135 | char *silcpurple_get_chat_name(PurpleProtocolChat *protocol_chat, GHashTable *data); |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
136 | void silcpurple_chat_invite(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int id, const char *msg, |
| 8849 | 137 | const char *name); |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
138 | void silcpurple_chat_leave(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int id); |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
139 | int silcpurple_chat_send(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int id, PurpleMessage *msg); |
|
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
140 | void silcpurple_chat_set_topic(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int id, const char *topic); |
| 15884 | 141 | PurpleRoomlist *silcpurple_roomlist_get_list(PurpleConnection *gc); |
| 142 | void silcpurple_roomlist_cancel(PurpleRoomlist *list); | |
| 143 | void silcpurple_chat_chauth_show(SilcPurple sg, SilcChannelEntry channel, | |
|
17675
e7069bf1de1a
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16549
diff
changeset
|
144 | SilcDList channel_pubkeys); |
| 15884 | 145 | void silcpurple_parse_attrs(SilcDList attrs, char **moodstr, char **statusstr, |
|
9488
9d6520fa53fd
[gaim-migrate @ 10313]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9466
diff
changeset
|
146 | char **contactstr, char **langstr, char **devicestr, |
|
9d6520fa53fd
[gaim-migrate @ 10313]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9466
diff
changeset
|
147 | char **tzstr, char **geostr); |
|
40769
2214cc7b95ca
Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40358
diff
changeset
|
148 | void silcpurple_buddy_set_icon(PurpleProtocolServer *protocol_server, PurpleConnection *gc, PurpleImage *img); |
|
33798
ab26d8e3da97
silc: Use appropriate datatype for SilcMessageFlags
Daniel Atallah <datallah@pidgin.im>
parents:
30708
diff
changeset
|
149 | SilcDList silcpurple_image_message(const char *msg, SilcMessageFlags *mflags); |
| 8849 | 150 | |
|
9353
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
151 | #ifdef _WIN32 |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
152 | typedef int uid_t; |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
153 | |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
154 | struct passwd { |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
155 | char *pw_name; /* user name */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
156 | char *pw_passwd; /* user password */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
157 | int pw_uid; /* user id */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
158 | int pw_gid; /* group id */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
159 | char *pw_gecos; /* real name */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
160 | char *pw_dir; /* home directory */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
161 | char *pw_shell; /* shell program */ |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
162 | }; |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
163 | |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
164 | struct passwd *getpwuid(int uid); |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
12217
diff
changeset
|
165 | int getuid(void); |
|
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
12217
diff
changeset
|
166 | int geteuid(void); |
|
9353
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
167 | #endif |
|
ff6546387358
[gaim-migrate @ 10161]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9288
diff
changeset
|
168 | |
|
39819
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
169 | #endif /* PURPLE_SILC_SILCPURPLE_H */ |