Mercurial > pidgin
annotate libpurple/protocols/silc/silcpurple.h @ 20628:b8962a8c5daa
merge of '33aead6e626883ef6ad44b79099f01d2da042d9a'
and 'f76b9e1feb23d6a4308ca0c80f5f85765d985aff'
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 23 Sep 2007 22:08:46 +0000 |
parents | 9a96d8711303 |
children | 6b02dba5bf41 |
rev | line source |
---|---|
15822 | 1 /* |
2 | |
3 silcpurple.h | |
4 | |
5 Author: Pekka Riikonen <priikone@silcnet.org> | |
6 | |
17568
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
7 Copyright (C) 2004 - 2007 Pekka Riikonen |
15822 | 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 | |
20 #ifndef SILCPURPLE_H | |
21 #define SILCPURPLE_H | |
22 | |
23 /* Purple includes */ | |
24 #include "internal.h" | |
25 #include "account.h" | |
26 #include "accountopt.h" | |
27 #include "cmds.h" | |
28 #include "conversation.h" | |
29 #include "debug.h" | |
30 #include "ft.h" | |
31 #include "notify.h" | |
32 #include "prpl.h" | |
33 #include "request.h" | |
34 #include "roomlist.h" | |
35 #include "server.h" | |
36 #include "util.h" | |
37 | |
38 /* Default public and private key file names */ | |
39 #define SILCPURPLE_PUBLIC_KEY_NAME "public_key.pub" | |
40 #define SILCPURPLE_PRIVATE_KEY_NAME "private_key.prv" | |
41 | |
42 /* Default settings for creating key pair */ | |
43 #define SILCPURPLE_DEF_PKCS "rsa" | |
44 #define SILCPURPLE_DEF_PKCS_LEN 2048 | |
45 | |
46 #define SILCPURPLE_PRVGRP 0x001fffff | |
47 | |
48 /* Status IDs */ | |
49 #define SILCPURPLE_STATUS_ID_OFFLINE "offline" | |
50 #define SILCPURPLE_STATUS_ID_AVAILABLE "available" | |
51 #define SILCPURPLE_STATUS_ID_HYPER "hyper" | |
52 #define SILCPURPLE_STATUS_ID_AWAY "away" | |
53 #define SILCPURPLE_STATUS_ID_BUSY "busy" | |
54 #define SILCPURPLE_STATUS_ID_INDISPOSED "indisposed" | |
55 #define SILCPURPLE_STATUS_ID_PAGE "page" | |
56 | |
57 typedef struct { | |
58 unsigned long id; | |
59 const char *channel; | |
60 unsigned long chid; | |
61 const char *parentch; | |
62 SilcChannelPrivateKey key; | |
63 } *SilcPurplePrvgrp; | |
64 | |
65 /* The SILC Purple plugin context */ | |
66 typedef struct SilcPurpleStruct { | |
67 SilcClient client; | |
68 SilcClientConnection conn; | |
17568
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
69 SilcPublicKey public_key; |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
70 SilcPrivateKey private_key; |
15822 | 71 |
72 guint scheduler; | |
73 PurpleConnection *gc; | |
74 PurpleAccount *account; | |
75 unsigned long channel_ids; | |
76 GList *grps; | |
77 | |
78 char *motd; | |
79 PurpleRoomlist *roomlist; | |
80 SilcMimeAssembler mimeass; | |
81 unsigned int detaching : 1; | |
82 unsigned int resuming : 1; | |
83 unsigned int roomlist_canceled : 1; | |
84 unsigned int chpk : 1; | |
85 } *SilcPurple; | |
86 | |
87 | |
17568
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
88 void silc_say(SilcClient client, SilcClientConnection conn, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
89 SilcClientMessageType type, char *msg, ...); |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
90 SilcBool silcpurple_command_reply(SilcClient client, SilcClientConnection conn, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
91 SilcCommand command, SilcStatus status, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
92 SilcStatus error, void *context, va_list ap); |
15822 | 93 gboolean silcpurple_check_silc_dir(PurpleConnection *gc); |
94 const char *silcpurple_silcdir(void); | |
95 const char *silcpurple_session_file(const char *account); | |
96 void silcpurple_verify_public_key(SilcClient client, SilcClientConnection conn, | |
17568
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
97 const char *name, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
98 SilcConnectionType conn_type, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
99 SilcPublicKey public_key, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
100 SilcVerifyPublicKey completion, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
101 void *context); |
15822 | 102 GList *silcpurple_buddy_menu(PurpleBuddy *buddy); |
103 void silcpurple_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group); | |
104 void silcpurple_send_buddylist(PurpleConnection *gc); | |
105 void silcpurple_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group); | |
106 void silcpurple_buddy_keyagr_request(SilcClient client, | |
17568
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
107 SilcClientConnection conn, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
108 SilcClientEntry client_entry, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
109 const char *hostname, SilcUInt16 port, |
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
110 SilcUInt16 protocol); |
15822 | 111 void silcpurple_idle_set(PurpleConnection *gc, int idle); |
112 void silcpurple_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full); | |
113 char *silcpurple_status_text(PurpleBuddy *b); | |
114 gboolean silcpurple_ip_is_private(const char *ip); | |
115 void silcpurple_ftp_send_file(PurpleConnection *gc, const char *name, const char *file); | |
116 PurpleXfer *silcpurple_ftp_new_xfer(PurpleConnection *gc, const char *name); | |
117 void silcpurple_ftp_request(SilcClient client, SilcClientConnection conn, | |
118 SilcClientEntry client_entry, SilcUInt32 session_id, | |
119 const char *hostname, SilcUInt16 port); | |
120 void silcpurple_show_public_key(SilcPurple sg, | |
121 const char *name, SilcPublicKey public_key, | |
122 GCallback callback, void *context); | |
123 void silcpurple_get_info(PurpleConnection *gc, const char *who); | |
124 SilcAttributePayload | |
125 silcpurple_get_attr(SilcDList attrs, SilcAttribute attribute); | |
126 void silcpurple_get_umode_string(SilcUInt32 mode, char *buf, | |
127 SilcUInt32 buf_size); | |
128 void silcpurple_get_chmode_string(SilcUInt32 mode, char *buf, | |
129 SilcUInt32 buf_size); | |
130 void silcpurple_get_chumode_string(SilcUInt32 mode, char *buf, | |
131 SilcUInt32 buf_size); | |
132 GList *silcpurple_chat_info(PurpleConnection *gc); | |
133 GHashTable *silcpurple_chat_info_defaults(PurpleConnection *gc, const char *chat_name); | |
134 GList *silcpurple_chat_menu(PurpleChat *); | |
135 void silcpurple_chat_join(PurpleConnection *gc, GHashTable *data); | |
136 char *silcpurple_get_chat_name(GHashTable *data); | |
137 void silcpurple_chat_invite(PurpleConnection *gc, int id, const char *msg, | |
138 const char *name); | |
139 void silcpurple_chat_leave(PurpleConnection *gc, int id); | |
140 int silcpurple_chat_send(PurpleConnection *gc, int id, const char *msg, PurpleMessageFlags flags); | |
141 void silcpurple_chat_set_topic(PurpleConnection *gc, int id, const char *topic); | |
142 PurpleRoomlist *silcpurple_roomlist_get_list(PurpleConnection *gc); | |
143 void silcpurple_roomlist_cancel(PurpleRoomlist *list); | |
144 void silcpurple_chat_chauth_show(SilcPurple sg, SilcChannelEntry channel, | |
17568
980a104267da
Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <stu@nosnilmot.com>
parents:
16485
diff
changeset
|
145 SilcDList channel_pubkeys); |
15822 | 146 void silcpurple_parse_attrs(SilcDList attrs, char **moodstr, char **statusstr, |
147 char **contactstr, char **langstr, char **devicestr, | |
148 char **tzstr, char **geostr); | |
16485
6c3b44ac71f3
Update SILC for imgstore changes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15822
diff
changeset
|
149 void silcpurple_buddy_set_icon(PurpleConnection *gc, PurpleStoredImage *img); |
15822 | 150 char *silcpurple_file2mime(const char *filename); |
151 SilcDList silcpurple_image_message(const char *msg, SilcUInt32 *mflags); | |
152 | |
153 #ifdef _WIN32 | |
154 typedef int uid_t; | |
155 | |
156 struct passwd { | |
157 char *pw_name; /* user name */ | |
158 char *pw_passwd; /* user password */ | |
159 int pw_uid; /* user id */ | |
160 int pw_gid; /* group id */ | |
161 char *pw_gecos; /* real name */ | |
162 char *pw_dir; /* home directory */ | |
163 char *pw_shell; /* shell program */ | |
164 }; | |
165 | |
166 struct passwd *getpwuid(int uid); | |
167 int getuid(void); | |
168 int geteuid(void); | |
169 #endif | |
170 | |
171 #endif /* SILCPURPLE_H */ |