1 | /********************************************************************\ |
---|
2 | * BitlBee -- An IRC to other IM-networks gateway * |
---|
3 | * * |
---|
4 | * Copyright 2002-2010 Wilmer van der Gaast and others * |
---|
5 | \********************************************************************/ |
---|
6 | |
---|
7 | /* Some glue to put the IRC and the IM stuff together. */ |
---|
8 | |
---|
9 | /* |
---|
10 | This program is free software; you can redistribute it and/or modify |
---|
11 | it under the terms of the GNU General Public License as published by |
---|
12 | the Free Software Foundation; either version 2 of the License, or |
---|
13 | (at your option) any later version. |
---|
14 | |
---|
15 | This program is distributed in the hope that it will be useful, |
---|
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | GNU General Public License for more details. |
---|
19 | |
---|
20 | You should have received a copy of the GNU General Public License with |
---|
21 | the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; |
---|
22 | if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
---|
23 | Suite 330, Boston, MA 02111-1307 USA |
---|
24 | */ |
---|
25 | |
---|
26 | #include "bitlbee.h" |
---|
27 | #include "dcc.h" |
---|
28 | |
---|
29 | /* IM->IRC callbacks: Simple IM/buddy-related stuff. */ |
---|
30 | |
---|
31 | static const struct irc_user_funcs irc_user_im_funcs; |
---|
32 | |
---|
33 | static gboolean bee_irc_user_new( bee_t *bee, bee_user_t *bu ) |
---|
34 | { |
---|
35 | irc_user_t *iu; |
---|
36 | char nick[MAX_NICK_LENGTH+1], *s; |
---|
37 | |
---|
38 | memset( nick, 0, MAX_NICK_LENGTH + 1 ); |
---|
39 | strcpy( nick, nick_get( bu->ic->acc, bu->handle ) ); |
---|
40 | |
---|
41 | bu->ui_data = iu = irc_user_new( (irc_t*) bee->ui_data, nick ); |
---|
42 | iu->bu = bu; |
---|
43 | |
---|
44 | if( ( s = strchr( bu->handle, '@' ) ) ) |
---|
45 | { |
---|
46 | iu->host = g_strdup( s + 1 ); |
---|
47 | iu->user = g_strndup( bu->handle, s - bu->handle ); |
---|
48 | } |
---|
49 | else if( bu->ic->acc->server ) |
---|
50 | { |
---|
51 | iu->host = g_strdup( bu->ic->acc->server ); |
---|
52 | iu->user = g_strdup( bu->handle ); |
---|
53 | |
---|
54 | /* s/ /_/ ... important for AOL screennames */ |
---|
55 | for( s = iu->user; *s; s ++ ) |
---|
56 | if( *s == ' ' ) |
---|
57 | *s = '_'; |
---|
58 | } |
---|
59 | else |
---|
60 | { |
---|
61 | iu->host = g_strdup( bu->ic->acc->prpl->name ); |
---|
62 | iu->user = g_strdup( bu->handle ); |
---|
63 | } |
---|
64 | |
---|
65 | if( set_getbool( &bee->set, "private" ) ) |
---|
66 | iu->flags |= IRC_USER_PRIVATE; |
---|
67 | |
---|
68 | iu->f = &irc_user_im_funcs; |
---|
69 | //iu->last_typing_notice = 0; |
---|
70 | |
---|
71 | return TRUE; |
---|
72 | } |
---|
73 | |
---|
74 | static gboolean bee_irc_user_free( bee_t *bee, bee_user_t *bu ) |
---|
75 | { |
---|
76 | return irc_user_free( bee->ui_data, (irc_user_t *) bu->ui_data ); |
---|
77 | } |
---|
78 | |
---|
79 | static gboolean bee_irc_user_status( bee_t *bee, bee_user_t *bu, bee_user_t *old ) |
---|
80 | { |
---|
81 | irc_t *irc = bee->ui_data; |
---|
82 | irc_user_t *iu = bu->ui_data; |
---|
83 | |
---|
84 | /* Do this outside the if below since away state can change without |
---|
85 | the online state changing. */ |
---|
86 | iu->flags &= ~IRC_USER_AWAY; |
---|
87 | if( bu->flags & BEE_USER_AWAY || !( bu->flags & BEE_USER_ONLINE ) ) |
---|
88 | iu->flags |= IRC_USER_AWAY; |
---|
89 | |
---|
90 | if( ( bu->flags & BEE_USER_ONLINE ) != ( old->flags & BEE_USER_ONLINE ) ) |
---|
91 | { |
---|
92 | if( bu->flags & BEE_USER_ONLINE ) |
---|
93 | { |
---|
94 | if( g_hash_table_lookup( irc->watches, iu->key ) ) |
---|
95 | irc_send_num( irc, 600, "%s %s %s %d :%s", iu->nick, iu->user, |
---|
96 | iu->host, (int) time( NULL ), "logged online" ); |
---|
97 | } |
---|
98 | else |
---|
99 | { |
---|
100 | if( g_hash_table_lookup( irc->watches, iu->key ) ) |
---|
101 | irc_send_num( irc, 601, "%s %s %s %d :%s", iu->nick, iu->user, |
---|
102 | iu->host, (int) time( NULL ), "logged offline" ); |
---|
103 | } |
---|
104 | } |
---|
105 | |
---|
106 | bee_irc_channel_update( irc, NULL, iu ); |
---|
107 | |
---|
108 | return TRUE; |
---|
109 | } |
---|
110 | |
---|
111 | void bee_irc_channel_update( irc_t *irc, irc_channel_t *ic, irc_user_t *iu ) |
---|
112 | { |
---|
113 | struct irc_control_channel *icc; |
---|
114 | GSList *l; |
---|
115 | gboolean show; |
---|
116 | |
---|
117 | if( ic == NULL ) |
---|
118 | { |
---|
119 | for( l = irc->channels; l; l = l->next ) |
---|
120 | { |
---|
121 | ic = l->data; |
---|
122 | /* TODO: Just add a type flag or so.. */ |
---|
123 | if( ic->f == irc->default_channel->f ) |
---|
124 | bee_irc_channel_update( irc, ic, iu ); |
---|
125 | } |
---|
126 | return; |
---|
127 | } |
---|
128 | if( iu == NULL ) |
---|
129 | { |
---|
130 | for( l = irc->users; l; l = l->next ) |
---|
131 | { |
---|
132 | iu = l->data; |
---|
133 | if( iu->bu ) |
---|
134 | bee_irc_channel_update( irc, ic, l->data ); |
---|
135 | } |
---|
136 | return; |
---|
137 | } |
---|
138 | |
---|
139 | icc = ic->data; |
---|
140 | |
---|
141 | if( !( iu->bu->flags & BEE_USER_ONLINE ) ) |
---|
142 | show = FALSE; |
---|
143 | else if( icc->type == IRC_CC_TYPE_DEFAULT ) |
---|
144 | show = TRUE; |
---|
145 | else if( icc->type == IRC_CC_TYPE_GROUP ) |
---|
146 | show = iu->bu->group == icc->group; |
---|
147 | |
---|
148 | if( !show ) |
---|
149 | { |
---|
150 | irc_channel_del_user( ic, iu ); |
---|
151 | } |
---|
152 | else |
---|
153 | { |
---|
154 | irc_channel_add_user( ic, iu ); |
---|
155 | |
---|
156 | if( set_getbool( &irc->b->set, "away_devoice" ) ) |
---|
157 | irc_channel_user_set_mode( ic, iu, ( iu->bu->flags & BEE_USER_AWAY ) ? |
---|
158 | 0 : IRC_CHANNEL_USER_VOICE ); |
---|
159 | } |
---|
160 | } |
---|
161 | |
---|
162 | static gboolean bee_irc_user_msg( bee_t *bee, bee_user_t *bu, const char *msg, time_t sent_at ) |
---|
163 | { |
---|
164 | irc_t *irc = bee->ui_data; |
---|
165 | irc_channel_t *ic = irc->default_channel; |
---|
166 | irc_user_t *iu = (irc_user_t *) bu->ui_data; |
---|
167 | char *dst, *prefix = NULL; |
---|
168 | char *wrapped, *ts = NULL; |
---|
169 | |
---|
170 | if( sent_at > 0 && set_getbool( &irc->b->set, "display_timestamps" ) ) |
---|
171 | ts = irc_format_timestamp( irc, sent_at ); |
---|
172 | |
---|
173 | if( iu->flags & IRC_USER_PRIVATE ) |
---|
174 | { |
---|
175 | dst = irc->user->nick; |
---|
176 | prefix = ts; |
---|
177 | ts = NULL; |
---|
178 | } |
---|
179 | else |
---|
180 | { |
---|
181 | dst = ic->name; |
---|
182 | prefix = g_strdup_printf( "%s%s%s", irc->user->nick, set_getstr( &bee->set, "to_char" ), ts ? : "" ); |
---|
183 | } |
---|
184 | |
---|
185 | wrapped = word_wrap( msg, 425 ); |
---|
186 | irc_send_msg( iu, "PRIVMSG", dst, wrapped, prefix ); |
---|
187 | |
---|
188 | g_free( wrapped ); |
---|
189 | g_free( prefix ); |
---|
190 | g_free( ts ); |
---|
191 | |
---|
192 | return TRUE; |
---|
193 | } |
---|
194 | |
---|
195 | static gboolean bee_irc_user_typing( bee_t *bee, bee_user_t *bu, uint32_t flags ) |
---|
196 | { |
---|
197 | irc_t *irc = (irc_t *) bee->ui_data; |
---|
198 | |
---|
199 | if( set_getbool( &bee->set, "typing_notice" ) ) |
---|
200 | irc_send_msg_f( (irc_user_t *) bu->ui_data, "PRIVMSG", irc->user->nick, |
---|
201 | "\001TYPING %d\001", ( flags >> 8 ) & 3 ); |
---|
202 | else |
---|
203 | return FALSE; |
---|
204 | |
---|
205 | return TRUE; |
---|
206 | } |
---|
207 | |
---|
208 | static gboolean bee_irc_user_fullname( bee_t *bee, bee_user_t *bu ) |
---|
209 | { |
---|
210 | irc_user_t *iu = (irc_user_t *) bu->ui_data; |
---|
211 | irc_t *irc = (irc_t *) bee->ui_data; |
---|
212 | char *s; |
---|
213 | |
---|
214 | if( iu->fullname != iu->nick ) |
---|
215 | g_free( iu->fullname ); |
---|
216 | iu->fullname = g_strdup( bu->fullname ); |
---|
217 | |
---|
218 | /* Strip newlines (unlikely, but IRC-unfriendly so they must go) |
---|
219 | TODO(wilmer): Do the same with away msgs again! */ |
---|
220 | for( s = iu->fullname; *s; s ++ ) |
---|
221 | if( isspace( *s ) ) *s = ' '; |
---|
222 | |
---|
223 | if( ( bu->ic->flags & OPT_LOGGED_IN ) && set_getbool( &bee->set, "display_namechanges" ) ) |
---|
224 | { |
---|
225 | char *msg = g_strdup_printf( "<< \002BitlBee\002 - Changed name to `%s' >>", iu->fullname ); |
---|
226 | irc_send_msg( iu, "NOTICE", irc->user->nick, msg, NULL ); |
---|
227 | } |
---|
228 | |
---|
229 | s = set_getstr( &bu->ic->acc->set, "nick_source" ); |
---|
230 | if( strcmp( s, "handle" ) != 0 ) |
---|
231 | { |
---|
232 | char *name = g_strdup( bu->fullname ); |
---|
233 | |
---|
234 | if( strcmp( s, "first_name" ) == 0 ) |
---|
235 | { |
---|
236 | int i; |
---|
237 | for( i = 0; name[i] && !isspace( name[i] ); i ++ ) {} |
---|
238 | name[i] = '\0'; |
---|
239 | } |
---|
240 | |
---|
241 | imcb_buddy_nick_hint( bu->ic, bu->handle, name ); |
---|
242 | |
---|
243 | g_free( name ); |
---|
244 | } |
---|
245 | |
---|
246 | return TRUE; |
---|
247 | } |
---|
248 | |
---|
249 | /* IRC->IM calls */ |
---|
250 | |
---|
251 | static gboolean bee_irc_user_privmsg( irc_user_t *iu, const char *msg ) |
---|
252 | { |
---|
253 | if( iu->bu ) |
---|
254 | return bee_user_msg( iu->irc->b, iu->bu, msg, 0 ); |
---|
255 | else |
---|
256 | return FALSE; |
---|
257 | } |
---|
258 | |
---|
259 | static gboolean bee_irc_user_ctcp( irc_user_t *iu, char *const *ctcp ) |
---|
260 | { |
---|
261 | if( ctcp[1] && g_strcasecmp( ctcp[0], "DCC" ) == 0 |
---|
262 | && g_strcasecmp( ctcp[1], "SEND" ) == 0 ) |
---|
263 | { |
---|
264 | if( iu->bu && iu->bu->ic && iu->bu->ic->acc->prpl->transfer_request ) |
---|
265 | { |
---|
266 | file_transfer_t *ft = dcc_request( iu->bu->ic, ctcp ); |
---|
267 | if ( ft ) |
---|
268 | iu->bu->ic->acc->prpl->transfer_request( iu->bu->ic, ft, iu->bu->handle ); |
---|
269 | |
---|
270 | return TRUE; |
---|
271 | } |
---|
272 | } |
---|
273 | else if( g_strcasecmp( ctcp[0], "TYPING" ) == 0 ) |
---|
274 | { |
---|
275 | if( iu->bu && iu->bu->ic && iu->bu->ic->acc->prpl->send_typing && ctcp[1] ) |
---|
276 | { |
---|
277 | int st = ctcp[1][0]; |
---|
278 | if( st >= '0' && st <= '2' ) |
---|
279 | { |
---|
280 | st <<= 8; |
---|
281 | iu->bu->ic->acc->prpl->send_typing( iu->bu->ic, iu->bu->handle, st ); |
---|
282 | } |
---|
283 | |
---|
284 | return TRUE; |
---|
285 | } |
---|
286 | } |
---|
287 | |
---|
288 | return FALSE; |
---|
289 | } |
---|
290 | |
---|
291 | static const struct irc_user_funcs irc_user_im_funcs = { |
---|
292 | bee_irc_user_privmsg, |
---|
293 | bee_irc_user_ctcp, |
---|
294 | }; |
---|
295 | |
---|
296 | |
---|
297 | /* IM->IRC: Groupchats */ |
---|
298 | static const struct irc_channel_funcs irc_channel_im_chat_funcs; |
---|
299 | |
---|
300 | static gboolean bee_irc_chat_new( bee_t *bee, struct groupchat *c ) |
---|
301 | { |
---|
302 | irc_t *irc = bee->ui_data; |
---|
303 | irc_channel_t *ic; |
---|
304 | char *topic; |
---|
305 | GSList *l; |
---|
306 | int i; |
---|
307 | |
---|
308 | /* Try to find a channel that expects to receive a groupchat. |
---|
309 | This flag is set by groupchat_stub_invite(). */ |
---|
310 | for( l = irc->channels; l; l = l->next ) |
---|
311 | { |
---|
312 | ic = l->data; |
---|
313 | if( ic->flags & IRC_CHANNEL_CHAT_PICKME ) |
---|
314 | break; |
---|
315 | } |
---|
316 | |
---|
317 | /* If we found none, just generate some stupid name. */ |
---|
318 | if( l == NULL ) for( i = 0; i <= 999; i ++ ) |
---|
319 | { |
---|
320 | char name[16]; |
---|
321 | sprintf( name, "&chat_%03d", i ); |
---|
322 | if( ( ic = irc_channel_new( irc, name ) ) ) |
---|
323 | break; |
---|
324 | } |
---|
325 | |
---|
326 | if( ic == NULL ) |
---|
327 | return FALSE; |
---|
328 | |
---|
329 | c->ui_data = ic; |
---|
330 | ic->data = c; |
---|
331 | ic->f = &irc_channel_im_chat_funcs; |
---|
332 | |
---|
333 | topic = g_strdup_printf( "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->title ); |
---|
334 | irc_channel_set_topic( ic, topic, irc->root ); |
---|
335 | g_free( topic ); |
---|
336 | |
---|
337 | return TRUE; |
---|
338 | } |
---|
339 | |
---|
340 | static gboolean bee_irc_chat_free( bee_t *bee, struct groupchat *c ) |
---|
341 | { |
---|
342 | irc_channel_t *ic = c->ui_data; |
---|
343 | |
---|
344 | if( ic->flags & IRC_CHANNEL_JOINED ) |
---|
345 | irc_channel_printf( ic, "Cleaning up channel, bye!" ); |
---|
346 | |
---|
347 | irc_channel_free( ic ); |
---|
348 | |
---|
349 | return TRUE; |
---|
350 | } |
---|
351 | |
---|
352 | static gboolean bee_irc_chat_log( bee_t *bee, struct groupchat *c, const char *text ) |
---|
353 | { |
---|
354 | irc_channel_t *ic = c->ui_data; |
---|
355 | |
---|
356 | irc_channel_printf( ic, "%s", text ); |
---|
357 | |
---|
358 | return TRUE; |
---|
359 | } |
---|
360 | |
---|
361 | static gboolean bee_irc_chat_msg( bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, time_t sent_at ) |
---|
362 | { |
---|
363 | irc_t *irc = bee->ui_data; |
---|
364 | irc_user_t *iu = bu->ui_data; |
---|
365 | irc_channel_t *ic = c->ui_data; |
---|
366 | char *ts = NULL; |
---|
367 | |
---|
368 | if( sent_at > 0 && set_getbool( &bee->set, "display_timestamps" ) ) |
---|
369 | ts = irc_format_timestamp( irc, sent_at ); |
---|
370 | |
---|
371 | irc_send_msg( iu, "PRIVMSG", ic->name, msg, ts ); |
---|
372 | g_free( ts ); |
---|
373 | |
---|
374 | return TRUE; |
---|
375 | } |
---|
376 | |
---|
377 | static gboolean bee_irc_chat_add_user( bee_t *bee, struct groupchat *c, bee_user_t *bu ) |
---|
378 | { |
---|
379 | irc_t *irc = bee->ui_data; |
---|
380 | |
---|
381 | irc_channel_add_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data ); |
---|
382 | |
---|
383 | return TRUE; |
---|
384 | } |
---|
385 | |
---|
386 | static gboolean bee_irc_chat_remove_user( bee_t *bee, struct groupchat *c, bee_user_t *bu ) |
---|
387 | { |
---|
388 | irc_t *irc = bee->ui_data; |
---|
389 | |
---|
390 | irc_channel_del_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data ); |
---|
391 | |
---|
392 | return TRUE; |
---|
393 | } |
---|
394 | |
---|
395 | static gboolean bee_irc_chat_topic( bee_t *bee, struct groupchat *c, const char *new, bee_user_t *bu ) |
---|
396 | { |
---|
397 | irc_t *irc = bee->ui_data; |
---|
398 | irc_user_t *iu; |
---|
399 | |
---|
400 | if( bu == NULL ) |
---|
401 | iu = irc->root; |
---|
402 | else if( bu == bee->user ) |
---|
403 | iu = irc->user; |
---|
404 | else |
---|
405 | iu = bu->ui_data; |
---|
406 | |
---|
407 | irc_channel_set_topic( c->ui_data, new, iu ); |
---|
408 | |
---|
409 | return TRUE; |
---|
410 | } |
---|
411 | |
---|
412 | static gboolean bee_irc_chat_name_hint( bee_t *bee, struct groupchat *c, const char *name ) |
---|
413 | { |
---|
414 | irc_t *irc = bee->ui_data; |
---|
415 | irc_channel_t *ic = c->ui_data; |
---|
416 | char stripped[MAX_NICK_LENGTH+1], *full_name; |
---|
417 | |
---|
418 | /* Don't rename a channel if the user's in it already. */ |
---|
419 | if( ic->flags & IRC_CHANNEL_JOINED ) |
---|
420 | return FALSE; |
---|
421 | |
---|
422 | strncpy( stripped, name, MAX_NICK_LENGTH ); |
---|
423 | stripped[MAX_NICK_LENGTH] = '\0'; |
---|
424 | nick_strip( stripped ); |
---|
425 | if( set_getbool( &bee->set, "lcnicks" ) ) |
---|
426 | nick_lc( stripped ); |
---|
427 | |
---|
428 | full_name = g_strdup_printf( "&%s", stripped ); |
---|
429 | |
---|
430 | if( stripped[0] && irc_channel_by_name( irc, full_name ) == NULL ) |
---|
431 | { |
---|
432 | g_free( ic->name ); |
---|
433 | ic->name = full_name; |
---|
434 | } |
---|
435 | else |
---|
436 | { |
---|
437 | g_free( full_name ); |
---|
438 | } |
---|
439 | |
---|
440 | return TRUE; |
---|
441 | } |
---|
442 | |
---|
443 | /* IRC->IM */ |
---|
444 | static gboolean bee_irc_channel_chat_privmsg( irc_channel_t *ic, const char *msg ) |
---|
445 | { |
---|
446 | struct groupchat *c = ic->data; |
---|
447 | |
---|
448 | bee_chat_msg( ic->irc->b, c, msg, 0 ); |
---|
449 | |
---|
450 | return TRUE; |
---|
451 | |
---|
452 | } |
---|
453 | |
---|
454 | static gboolean bee_irc_channel_chat_part( irc_channel_t *ic, const char *msg ) |
---|
455 | { |
---|
456 | struct groupchat *c = ic->data; |
---|
457 | |
---|
458 | if( c->ic->acc->prpl->chat_leave ) |
---|
459 | c->ic->acc->prpl->chat_leave( c ); |
---|
460 | |
---|
461 | return TRUE; |
---|
462 | |
---|
463 | } |
---|
464 | |
---|
465 | static gboolean bee_irc_channel_chat_topic( irc_channel_t *ic, const char *new ) |
---|
466 | { |
---|
467 | return TRUE; |
---|
468 | } |
---|
469 | |
---|
470 | static gboolean bee_irc_channel_chat_invite( irc_channel_t *ic, irc_user_t *iu ) |
---|
471 | { |
---|
472 | struct groupchat *c = ic->data; |
---|
473 | |
---|
474 | if( iu->bu->ic != c->ic ) |
---|
475 | irc_send_num( ic->irc, 482, "%s :Can't mix different IM networks in one groupchat", ic->name ); |
---|
476 | else if( c->ic->acc->prpl->chat_invite ) |
---|
477 | c->ic->acc->prpl->chat_invite( c, iu->bu->handle, NULL ); |
---|
478 | else |
---|
479 | irc_send_num( ic->irc, 482, "%s :IM protocol does not support room invitations", ic->name ); |
---|
480 | |
---|
481 | return TRUE; |
---|
482 | } |
---|
483 | |
---|
484 | static const struct irc_channel_funcs irc_channel_im_chat_funcs = { |
---|
485 | bee_irc_channel_chat_privmsg, |
---|
486 | NULL, /* join */ |
---|
487 | bee_irc_channel_chat_part, |
---|
488 | bee_irc_channel_chat_topic, |
---|
489 | bee_irc_channel_chat_invite, |
---|
490 | }; |
---|
491 | |
---|
492 | |
---|
493 | /* IM->IRC: File transfers */ |
---|
494 | static file_transfer_t *bee_irc_ft_in_start( bee_t *bee, bee_user_t *bu, const char *file_name, size_t file_size ) |
---|
495 | { |
---|
496 | return dccs_send_start( bu->ic, (irc_user_t *) bu->ui_data, file_name, file_size ); |
---|
497 | } |
---|
498 | |
---|
499 | static gboolean bee_irc_ft_out_start( struct im_connection *ic, file_transfer_t *ft ) |
---|
500 | { |
---|
501 | return dccs_recv_start( ft ); |
---|
502 | } |
---|
503 | |
---|
504 | static void bee_irc_ft_close( struct im_connection *ic, file_transfer_t *ft ) |
---|
505 | { |
---|
506 | return dcc_close( ft ); |
---|
507 | } |
---|
508 | |
---|
509 | static void bee_irc_ft_finished( struct im_connection *ic, file_transfer_t *file ) |
---|
510 | { |
---|
511 | dcc_file_transfer_t *df = file->priv; |
---|
512 | |
---|
513 | if( file->bytes_transferred >= file->file_size ) |
---|
514 | dcc_finish( file ); |
---|
515 | else |
---|
516 | df->proto_finished = TRUE; |
---|
517 | } |
---|
518 | |
---|
519 | const struct bee_ui_funcs irc_ui_funcs = { |
---|
520 | bee_irc_user_new, |
---|
521 | bee_irc_user_free, |
---|
522 | bee_irc_user_fullname, |
---|
523 | bee_irc_user_status, |
---|
524 | bee_irc_user_msg, |
---|
525 | bee_irc_user_typing, |
---|
526 | |
---|
527 | bee_irc_chat_new, |
---|
528 | bee_irc_chat_free, |
---|
529 | bee_irc_chat_log, |
---|
530 | bee_irc_chat_msg, |
---|
531 | bee_irc_chat_add_user, |
---|
532 | bee_irc_chat_remove_user, |
---|
533 | bee_irc_chat_topic, |
---|
534 | bee_irc_chat_name_hint, |
---|
535 | |
---|
536 | bee_irc_ft_in_start, |
---|
537 | bee_irc_ft_out_start, |
---|
538 | bee_irc_ft_close, |
---|
539 | bee_irc_ft_finished, |
---|
540 | }; |
---|