Mercurial > pidgin.yaz
annotate libgaim/protocols/irc/irc.h @ 14482:a5c7db7be826
[gaim-migrate @ 17201]
Prevent irc accounts from being disconnected for long periods without us noticing. Use the prpl keepalive cb to ping the server if we haven't received anything in at least 60 seconds.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Sat, 09 Sep 2006 19:39:31 +0000 |
parents | baff095b146c |
children | 118fd0dc5b6e |
rev | line source |
---|---|
14192 | 1 /** |
2 * @file irc.h | |
3 * | |
4 * gaim | |
5 * | |
6 * Copyright (C) 2003, Ethan Blanton <eblanton@cs.purdue.edu> | |
7 * | |
8 * This program is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
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 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 */ | |
22 | |
23 #ifndef _GAIM_IRC_H | |
24 #define _GAIM_IRC_H | |
25 | |
26 #include <glib.h> | |
27 | |
28 #include "circbuffer.h" | |
29 #include "ft.h" | |
30 #include "roomlist.h" | |
31 #include "sslconn.h" | |
32 | |
33 #define IRC_DEFAULT_SERVER "irc.freenode.net" | |
34 #define IRC_DEFAULT_PORT 6667 | |
35 #define IRC_DEFAULT_SSL_PORT 994 | |
36 | |
37 #define IRC_DEFAULT_CHARSET "UTF-8" | |
38 #define IRC_DEFAULT_ALIAS "gaim" | |
39 | |
40 #define IRC_DEFAULT_QUIT "Leaving." | |
41 | |
42 #define IRC_INITIAL_BUFSIZE 1024 | |
43 | |
44 | |
45 enum { IRC_USEROPT_SERVER, IRC_USEROPT_PORT, IRC_USEROPT_CHARSET }; | |
46 enum irc_state { IRC_STATE_NEW, IRC_STATE_ESTABLISHED }; | |
47 | |
48 struct irc_conn { | |
49 GaimAccount *account; | |
50 GHashTable *msgs; | |
51 GHashTable *cmds; | |
52 char *server; | |
53 int fd; | |
54 guint timer; | |
55 GHashTable *buddies; | |
56 | |
14262 | 57 GaimProxyConnectData *connect_data; |
14192 | 58 |
59 char *inbuf; | |
60 int inbuflen; | |
61 int inbufused; | |
62 | |
63 GString *motd; | |
64 GString *names; | |
65 char *nameconv; | |
66 struct _whois { | |
67 char *nick; | |
68 char *away; | |
69 char *userhost; | |
70 char *name; | |
71 char *server; | |
72 char *serverinfo; | |
73 char *channels; | |
74 int ircop; | |
75 int identified; | |
76 int idle; | |
77 time_t signon; | |
78 } whois; | |
79 GaimRoomlist *roomlist; | |
80 GaimSslConnection *gsc; | |
81 | |
82 gboolean quitting; | |
83 | |
84 GaimCircBuffer *outbuf; | |
85 guint writeh; | |
14482
a5c7db7be826
[gaim-migrate @ 17201]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14262
diff
changeset
|
86 |
a5c7db7be826
[gaim-migrate @ 17201]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14262
diff
changeset
|
87 time_t recv_time; |
14192 | 88 }; |
89 | |
90 struct irc_buddy { | |
91 char *name; | |
92 gboolean online; | |
93 gboolean flag; | |
94 }; | |
95 | |
96 typedef int (*IRCCmdCallback) (struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
97 | |
98 int irc_send(struct irc_conn *irc, const char *buf); | |
99 gboolean irc_blist_timeout(struct irc_conn *irc); | |
100 | |
101 char *irc_mirc2html(const char *string); | |
102 char *irc_mirc2txt(const char *string); | |
103 | |
104 gboolean irc_ischannel(const char *string); | |
105 | |
106 void irc_register_commands(void); | |
107 void irc_msg_table_build(struct irc_conn *irc); | |
108 void irc_parse_msg(struct irc_conn *irc, char *input); | |
109 char *irc_parse_ctcp(struct irc_conn *irc, const char *from, const char *to, const char *msg, int notice); | |
110 char *irc_format(struct irc_conn *irc, const char *format, ...); | |
111 | |
112 void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args); | |
113 void irc_msg_away(struct irc_conn *irc, const char *name, const char *from, char **args); | |
114 void irc_msg_badmode(struct irc_conn *irc, const char *name, const char *from, char **args); | |
115 void irc_msg_badnick(struct irc_conn *irc, const char *name, const char *from, char **args); | |
116 void irc_msg_banfull(struct irc_conn *irc, const char *name, const char *from, char **args); | |
117 void irc_msg_banned(struct irc_conn *irc, const char *name, const char *from, char **args); | |
118 void irc_msg_chanmode(struct irc_conn *irc, const char *name, const char *from, char **args); | |
119 void irc_msg_endwhois(struct irc_conn *irc, const char *name, const char *from, char **args); | |
120 void irc_msg_endmotd(struct irc_conn *irc, const char *name, const char *from, char **args); | |
121 void irc_msg_invite(struct irc_conn *irc, const char *name, const char *from, char **args); | |
122 void irc_msg_inviteonly(struct irc_conn *irc, const char *name, const char *from, char **args); | |
123 void irc_msg_ison(struct irc_conn *irc, const char *name, const char *from, char **args); | |
124 void irc_msg_join(struct irc_conn *irc, const char *name, const char *from, char **args); | |
125 void irc_msg_kick(struct irc_conn *irc, const char *name, const char *from, char **args); | |
126 void irc_msg_list(struct irc_conn *irc, const char *name, const char *from, char **args); | |
127 void irc_msg_mode(struct irc_conn *irc, const char *name, const char *from, char **args); | |
128 void irc_msg_motd(struct irc_conn *irc, const char *name, const char *from, char **args); | |
129 void irc_msg_names(struct irc_conn *irc, const char *name, const char *from, char **args); | |
130 void irc_msg_nick(struct irc_conn *irc, const char *name, const char *from, char **args); | |
131 void irc_msg_nickused(struct irc_conn *irc, const char *name, const char *from, char **args); | |
132 void irc_msg_nochan(struct irc_conn *irc, const char *name, const char *from, char **args); | |
133 void irc_msg_nonick(struct irc_conn *irc, const char *name, const char *from, char **args); | |
134 void irc_msg_nochangenick(struct irc_conn *irc, const char *name, const char *from, char **args); | |
135 void irc_msg_nosend(struct irc_conn *irc, const char *name, const char *from, char **args); | |
136 void irc_msg_notice(struct irc_conn *irc, const char *name, const char *from, char **args); | |
137 void irc_msg_notinchan(struct irc_conn *irc, const char *name, const char *from, char **args); | |
138 void irc_msg_notop(struct irc_conn *irc, const char *name, const char *from, char **args); | |
139 void irc_msg_part(struct irc_conn *irc, const char *name, const char *from, char **args); | |
140 void irc_msg_ping(struct irc_conn *irc, const char *name, const char *from, char **args); | |
141 void irc_msg_pong(struct irc_conn *irc, const char *name, const char *from, char **args); | |
142 void irc_msg_privmsg(struct irc_conn *irc, const char *name, const char *from, char **args); | |
143 void irc_msg_regonly(struct irc_conn *irc, const char *name, const char *from, char **args); | |
144 void irc_msg_quit(struct irc_conn *irc, const char *name, const char *from, char **args); | |
145 void irc_msg_time(struct irc_conn *irc, const char *name, const char *from, char **args); | |
146 void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args); | |
147 void irc_msg_unavailable(struct irc_conn *irc, const char *name, const char *from, char **args); | |
148 void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args); | |
149 void irc_msg_wallops(struct irc_conn *irc, const char *name, const char *from, char **args); | |
150 void irc_msg_whois(struct irc_conn *irc, const char *name, const char *from, char **args); | |
151 | |
152 void irc_msg_ignore(struct irc_conn *irc, const char *name, const char *from, char **args); | |
153 | |
154 void irc_cmd_table_build(struct irc_conn *irc); | |
155 | |
156 int irc_cmd_default(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
157 int irc_cmd_away(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
158 int irc_cmd_ctcp_action(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
159 int irc_cmd_ctcp_version(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
160 int irc_cmd_invite(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
161 int irc_cmd_join(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
162 int irc_cmd_kick(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
163 int irc_cmd_list(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
164 int irc_cmd_mode(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
165 int irc_cmd_names(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
166 int irc_cmd_nick(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
167 int irc_cmd_op(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
168 int irc_cmd_privmsg(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
169 int irc_cmd_part(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
170 int irc_cmd_ping(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
171 int irc_cmd_quit(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
172 int irc_cmd_quote(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
173 int irc_cmd_query(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
174 int irc_cmd_remove(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
175 int irc_cmd_service(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
176 int irc_cmd_time(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
177 int irc_cmd_topic(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
178 int irc_cmd_wallops(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
179 int irc_cmd_whois(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
180 | |
181 GaimXfer *irc_dccsend_new_xfer(GaimConnection *gc, const char *who); | |
182 void irc_dccsend_send_file(GaimConnection *gc, const char *who, const char *file); | |
183 void irc_dccsend_recv(struct irc_conn *irc, const char *from, const char *msg); | |
184 #endif /* _GAIM_IRC_H */ |