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"
|
|
27 #include "debug.h"
|
|
28 #include "multi.h"
|
|
29 #include "notify.h"
|
|
30 #include "prpl.h"
|
|
31 #include "request.h"
|
|
32 #include "server.h"
|
|
33 #include "util.h"
|
|
34 #include "roomlist.h"
|
|
35 #include "ft.h"
|
|
36
|
|
37 /* Default public and private key file names */
|
|
38 #define SILCGAIM_PUBLIC_KEY_NAME "public_key.pub"
|
|
39 #define SILCGAIM_PRIVATE_KEY_NAME "private_key.prv"
|
|
40
|
|
41 /* Default settings for creating key pair */
|
|
42 #define SILCGAIM_DEF_PKCS "rsa"
|
|
43 #define SILCGAIM_DEF_PKCS_LEN 2048
|
|
44
|
|
45 #define SILCGAIM_PRVGRP 0x001fffff
|
|
46
|
|
47 typedef struct {
|
|
48 unsigned long id;
|
|
49 const char *channel;
|
|
50 unsigned long chid;
|
|
51 const char *parentch;
|
|
52 SilcChannelPrivateKey key;
|
|
53 } *SilcGaimPrvgrp;
|
|
54
|
|
55 /* The SILC Gaim plugin context */
|
|
56 typedef struct SilcGaimStruct {
|
|
57 SilcClient client;
|
|
58 SilcClientConnection conn;
|
|
59
|
|
60 guint scheduler;
|
|
61 GaimConnection *gc;
|
|
62 GaimAccount *account;
|
|
63 unsigned long channel_ids;
|
|
64 GList *grps;
|
|
65
|
|
66 char *motd;
|
|
67 GaimRoomlist *roomlist;
|
|
68
|
|
69 unsigned int detaching : 1;
|
|
70 unsigned int resuming : 1;
|
|
71 unsigned int roomlist_canceled : 1;
|
|
72 unsigned int chpk : 1;
|
|
73 } *SilcGaim;
|
|
74
|
|
75
|
|
76 gboolean silcgaim_check_silc_dir(GaimConnection *gc);
|
|
77 void silcgaim_chat_join_done(SilcClient client,
|
|
78 SilcClientConnection conn,
|
|
79 SilcClientEntry *clients,
|
|
80 SilcUInt32 clients_count,
|
|
81 void *context);
|
|
82 const char *silcgaim_silcdir(void);
|
|
83 const char *silcgaim_session_file(const char *account);
|
|
84 void silcgaim_verify_public_key(SilcClient client, SilcClientConnection conn,
|
|
85 const char *name, SilcSocketType conn_type,
|
|
86 unsigned char *pk, SilcUInt32 pk_len,
|
|
87 SilcSKEPKType pk_type,
|
|
88 SilcVerifyPublicKey completion, void *context);
|
9038
|
89 GList *silcgaim_buddy_menu(GaimBuddy *buddy);
|
8849
|
90 void silcgaim_add_buddy(GaimConnection *gc, const char *name, GaimGroup *grp);
|
|
91 void silcgaim_add_buddies(GaimConnection *gc, GList *buddies);
|
|
92 void silcgaim_remove_buddy(GaimConnection *gc, const char *name,
|
|
93 const char *group);
|
|
94 void silcgaim_buddy_keyagr_request(SilcClient client,
|
|
95 SilcClientConnection conn,
|
|
96 SilcClientEntry client_entry,
|
|
97 const char *hostname, SilcUInt16 port);
|
|
98 void silcgaim_idle_set(GaimConnection *gc, int idle);
|
|
99 char *silcgaim_tooltip_text(GaimBuddy *b);
|
|
100 char *silcgaim_status_text(GaimBuddy *b);
|
|
101 gboolean silcgaim_ip_is_private(const char *ip);
|
|
102 void silcgaim_ftp_send_file(GaimConnection *gc, const char *name);
|
|
103 void silcgaim_ftp_request(SilcClient client, SilcClientConnection conn,
|
|
104 SilcClientEntry client_entry, SilcUInt32 session_id,
|
|
105 const char *hostname, SilcUInt16 port);
|
|
106 void silcgaim_show_public_key(SilcGaim sg,
|
|
107 const char *name, SilcPublicKey public_key,
|
|
108 GCallback callback, void *context);
|
|
109 void silcgaim_get_info(GaimConnection *gc, const char *who);
|
|
110 SilcAttributePayload
|
|
111 silcgaim_get_attr(SilcDList attrs, SilcAttribute attribute);
|
|
112 void silcgaim_get_umode_string(SilcUInt32 mode, char *buf,
|
|
113 SilcUInt32 buf_size);
|
|
114 void silcgaim_get_chmode_string(SilcUInt32 mode, char *buf,
|
|
115 SilcUInt32 buf_size);
|
|
116 void silcgaim_get_chumode_string(SilcUInt32 mode, char *buf,
|
|
117 SilcUInt32 buf_size);
|
|
118 GList *silcgaim_chat_info(GaimConnection *gc);
|
9038
|
119 GList *silcgaim_chat_menu(GaimChat *);
|
8849
|
120 void silcgaim_chat_join(GaimConnection *gc, GHashTable *data);
|
|
121 void silcgaim_chat_invite(GaimConnection *gc, int id, const char *msg,
|
|
122 const char *name);
|
|
123 void silcgaim_chat_leave(GaimConnection *gc, int id);
|
|
124 int silcgaim_chat_send(GaimConnection *gc, int id, const char *msg);
|
|
125 void silcgaim_chat_set_topic(GaimConnection *gc, int id, const char *topic);
|
|
126 GaimRoomlist *silcgaim_roomlist_get_list(GaimConnection *gc);
|
|
127 void silcgaim_roomlist_cancel(GaimRoomlist *list);
|
|
128 void silcgaim_chat_chauth_show(SilcGaim sg, SilcChannelEntry channel,
|
|
129 SilcBuffer channel_pubkeys);
|
|
130
|
|
131 #endif /* SILCGAIM_H */
|