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