8849
|
1 /*
|
|
2
|
|
3 silcgaim.h
|
|
4
|
|
5 Author: Pekka Riikonen <priikone@silcnet.org>
|
|
6
|
|
7 Copyright (C) 2004 Pekka Riikonen
|
|
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 SILCGAIM_H
|
|
21 #define SILCGAIM_H
|
|
22
|
|
23 /* Gaim includes */
|
|
24 #include "internal.h"
|
|
25 #include "account.h"
|
|
26 #include "accountopt.h"
|
10246
|
27 #include "cmds.h"
|
|
28 #include "conversation.h"
|
8849
|
29 #include "debug.h"
|
10246
|
30 #include "ft.h"
|
8849
|
31 #include "notify.h"
|
|
32 #include "prpl.h"
|
|
33 #include "request.h"
|
10246
|
34 #include "roomlist.h"
|
8849
|
35 #include "server.h"
|
|
36 #include "util.h"
|
|
37
|
|
38 /* Default public and private key file names */
|
|
39 #define SILCGAIM_PUBLIC_KEY_NAME "public_key.pub"
|
|
40 #define SILCGAIM_PRIVATE_KEY_NAME "private_key.prv"
|
|
41
|
|
42 /* Default settings for creating key pair */
|
|
43 #define SILCGAIM_DEF_PKCS "rsa"
|
|
44 #define SILCGAIM_DEF_PKCS_LEN 2048
|
|
45
|
|
46 #define SILCGAIM_PRVGRP 0x001fffff
|
|
47
|
10050
|
48 /* Status IDs */
|
|
49 #define SILCGAIM_STATUS_ID_OFFLINE "offline"
|
|
50 #define SILCGAIM_STATUS_ID_ONLINE "online"
|
10801
|
51 #define SILCGAIM_STATUS_ID_AVAILABLE "available"
|
10050
|
52 #define SILCGAIM_STATUS_ID_HYPER "hyper"
|
|
53 #define SILCGAIM_STATUS_ID_AWAY "away"
|
|
54 #define SILCGAIM_STATUS_ID_BUSY "busy"
|
|
55 #define SILCGAIM_STATUS_ID_INDISPOSED "indisposed"
|
|
56 #define SILCGAIM_STATUS_ID_PAGE "page"
|
|
57
|
8849
|
58 typedef struct {
|
|
59 unsigned long id;
|
|
60 const char *channel;
|
|
61 unsigned long chid;
|
|
62 const char *parentch;
|
|
63 SilcChannelPrivateKey key;
|
|
64 } *SilcGaimPrvgrp;
|
|
65
|
|
66 /* The SILC Gaim plugin context */
|
|
67 typedef struct SilcGaimStruct {
|
|
68 SilcClient client;
|
|
69 SilcClientConnection conn;
|
|
70
|
|
71 guint scheduler;
|
|
72 GaimConnection *gc;
|
|
73 GaimAccount *account;
|
|
74 unsigned long channel_ids;
|
|
75 GList *grps;
|
|
76
|
|
77 char *motd;
|
|
78 GaimRoomlist *roomlist;
|
|
79
|
|
80 unsigned int detaching : 1;
|
|
81 unsigned int resuming : 1;
|
|
82 unsigned int roomlist_canceled : 1;
|
|
83 unsigned int chpk : 1;
|
|
84 } *SilcGaim;
|
|
85
|
|
86
|
|
87 gboolean silcgaim_check_silc_dir(GaimConnection *gc);
|
|
88 void silcgaim_chat_join_done(SilcClient client,
|
|
89 SilcClientConnection conn,
|
|
90 SilcClientEntry *clients,
|
|
91 SilcUInt32 clients_count,
|
|
92 void *context);
|
|
93 const char *silcgaim_silcdir(void);
|
|
94 const char *silcgaim_session_file(const char *account);
|
|
95 void silcgaim_verify_public_key(SilcClient client, SilcClientConnection conn,
|
|
96 const char *name, SilcSocketType conn_type,
|
|
97 unsigned char *pk, SilcUInt32 pk_len,
|
|
98 SilcSKEPKType pk_type,
|
|
99 SilcVerifyPublicKey completion, void *context);
|
9038
|
100 GList *silcgaim_buddy_menu(GaimBuddy *buddy);
|
9288
|
101 void silcgaim_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group);
|
10341
|
102 void silcgaim_add_buddies(GaimConnection *gc, GList *buddies, GList *groups);
|
9288
|
103 void silcgaim_remove_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group);
|
8849
|
104 void silcgaim_buddy_keyagr_request(SilcClient client,
|
|
105 SilcClientConnection conn,
|
|
106 SilcClientEntry client_entry,
|
|
107 const char *hostname, SilcUInt16 port);
|
|
108 void silcgaim_idle_set(GaimConnection *gc, int idle);
|
|
109 char *silcgaim_tooltip_text(GaimBuddy *b);
|
|
110 char *silcgaim_status_text(GaimBuddy *b);
|
|
111 gboolean silcgaim_ip_is_private(const char *ip);
|
9466
|
112 void silcgaim_ftp_send_file(GaimConnection *gc, const char *name, const char *file);
|
8849
|
113 void silcgaim_ftp_request(SilcClient client, SilcClientConnection conn,
|
|
114 SilcClientEntry client_entry, SilcUInt32 session_id,
|
|
115 const char *hostname, SilcUInt16 port);
|
|
116 void silcgaim_show_public_key(SilcGaim sg,
|
|
117 const char *name, SilcPublicKey public_key,
|
|
118 GCallback callback, void *context);
|
|
119 void silcgaim_get_info(GaimConnection *gc, const char *who);
|
|
120 SilcAttributePayload
|
|
121 silcgaim_get_attr(SilcDList attrs, SilcAttribute attribute);
|
|
122 void silcgaim_get_umode_string(SilcUInt32 mode, char *buf,
|
|
123 SilcUInt32 buf_size);
|
|
124 void silcgaim_get_chmode_string(SilcUInt32 mode, char *buf,
|
|
125 SilcUInt32 buf_size);
|
|
126 void silcgaim_get_chumode_string(SilcUInt32 mode, char *buf,
|
|
127 SilcUInt32 buf_size);
|
|
128 GList *silcgaim_chat_info(GaimConnection *gc);
|
9756
|
129 GHashTable *silcgaim_chat_info_defaults(GaimConnection *gc, const char *chat_name);
|
9038
|
130 GList *silcgaim_chat_menu(GaimChat *);
|
8849
|
131 void silcgaim_chat_join(GaimConnection *gc, GHashTable *data);
|
9917
|
132 char *silcgaim_get_chat_name(GHashTable *data);
|
8849
|
133 void silcgaim_chat_invite(GaimConnection *gc, int id, const char *msg,
|
|
134 const char *name);
|
|
135 void silcgaim_chat_leave(GaimConnection *gc, int id);
|
|
136 int silcgaim_chat_send(GaimConnection *gc, int id, const char *msg);
|
|
137 void silcgaim_chat_set_topic(GaimConnection *gc, int id, const char *topic);
|
|
138 GaimRoomlist *silcgaim_roomlist_get_list(GaimConnection *gc);
|
|
139 void silcgaim_roomlist_cancel(GaimRoomlist *list);
|
|
140 void silcgaim_chat_chauth_show(SilcGaim sg, SilcChannelEntry channel,
|
|
141 SilcBuffer channel_pubkeys);
|
9488
|
142 void silcgaim_parse_attrs(SilcDList attrs, char **moodstr, char **statusstr,
|
|
143 char **contactstr, char **langstr, char **devicestr,
|
|
144 char **tzstr, char **geostr);
|
8849
|
145
|
9353
|
146 #ifdef _WIN32
|
|
147 typedef int uid_t;
|
|
148
|
|
149 struct passwd {
|
|
150 char *pw_name; /* user name */
|
|
151 char *pw_passwd; /* user password */
|
|
152 int pw_uid; /* user id */
|
|
153 int pw_gid; /* group id */
|
|
154 char *pw_gecos; /* real name */
|
|
155 char *pw_dir; /* home directory */
|
|
156 char *pw_shell; /* shell program */
|
|
157 };
|
|
158
|
|
159 struct passwd *getpwuid(int uid);
|
|
160 int getuid();
|
|
161 int geteuid();
|
|
162 #endif
|
|
163
|
8849
|
164 #endif /* SILCGAIM_H */
|