source: irc.h @ 6cac643

Last change on this file since 6cac643 was 1ba7e8f, checked in by ulim <a.sporto+bee@…>, at 2008-02-15T17:38:57Z

Merged with upstream r328

Wilmer van der Gaast 2008-02-11 Got rid of some noise at startup: complaining when the default configuration

Wilmer van der Gaast 2008-02-10 Added support for password-protected Jabber chatrooms.
Wilmer van der Gaast 2008-02-10 Making AI_ADDRCONFIG optional, it doesn't exist on at least NetBSD and
Wilmer van der Gaast 2008-02-09 Restored "add -tmp". A bit hackish, but it will do for now.
Wilmer van der Gaast 2008-02-07 Fixed getnameinfo() calls, this fixes Solaris stability issues. Thanks to
Wilmer van der Gaast 2008-02-04 Added bogus G_GNUC_MALLOC to restore GLib 2.4 compatibility (hopefully).
Wilmer van der Gaast 2008-02-03 Messages from the user are also included in backlogs when joining a Jabber
Wilmer van der Gaast 2008-02-03 Disabling "Unknown command" warnings since they're very noisy and pretty
Wilmer van der Gaast 2008-02-03 Implemented XEP-0115. This adds some info to the <presence/> tags so
Wilmer van der Gaast 2008-02-03 Saner garbage collection of cached packets in the Jabber module. Now
Wilmer van der Gaast 2008-02-02 Added help_free() and cleaned up some very stale help-related stuff I
Wilmer van der Gaast 2008-01-30 Fixed handling of OSCAR multi-part messages... They're not arrays, they're
Wilmer van der Gaast 2008-01-24 Keeping track of valid Jabber connections so _connected() events will be
Wilmer van der Gaast 2008-01-24 Fixed two valgrind warnings (partially uninitialized "struct tm" vars.)
Wilmer van der Gaast 2008-01-20 The Jabber module now uses imcb_chat_log() instead of imcb_log() where
Wilmer van der Gaast 2008-01-20 Added imcb_chat_log() for chatroom system messages, so they can be
Wilmer van der Gaast 2008-01-20 GET_BUDDY_FIRST wasn't actually implemented, even though it was in use
Wilmer van der Gaast 2008-01-19 Using test -f instead of test -e. This breaks if the include files are
Wilmer van der Gaast 2008-01-19 Added byte swapping code to the new MD5 checksumming code to make it work
Wilmer van der Gaast 2008-01-18 Moving imcb_chat_new() to a saner location (no code changes) and fixing
Wilmer van der Gaast 2008-01-17 Apparently ext_yahoo_got_im can be called with msg=NULL, so it should be
Wilmer van der Gaast 2008-01-17 Fixing some Solaris compiler warnings (u_int->uint, adding some typecasts
Wilmer van der Gaast 2008-01-13 Fixed handing of failed groupchat joins.
Wilmer van der Gaast 2008-01-13 Fixed "Conditional jump or move depends on uninitialised value(s)" at
Wilmer van der Gaast 2008-01-13 Fixed quickstart2. (Bug #349.)
Wilmer van der Gaast 2008-01-13 Different handling of charset mismatches before login time. Ignoring a
Wilmer van der Gaast 2008-01-12 When a switchboard connection dies (at the TCP level) and there are still
Wilmer van der Gaast 2008-01-12 Killed info_string_append() and now showing the IP address of ICQ users
Wilmer van der Gaast 2008-01-11 Fixing bug #344, now away states should always be correct, even when people
Wilmer van der Gaast 2008-01-11 Adding own handle to protocol name in blist output for people with multiple
Wilmer van der Gaast 2008-01-10 Now setting odata->icq properly again, this got lost some time ago, which
Wilmer van der Gaast 2008-01-06 More consistency in error/warning errors. Until now "WARNING:" was usually
Wilmer van der Gaast 2008-01-06 Changed warning message about unsent MSN messages. It should show the actual
Wilmer van der Gaast 2008-01-05 Added "mail_notifications" setting. Who needs those notifications anyway?
Wilmer van der Gaast 2008-01-05 Build fix from vmiklos.
Wilmer van der Gaast 2008-01-05 Added handling of MSN switchboard NAK messages. Untested, but hey, it
Wilmer van der Gaast 2008-01-05 Removed closure->result. I was planning to add some more stuff, but will
Miklos Vajna 2007-12-31 encode: md5.c is no longer in protocols/, it's in lib/
Wilmer van der Gaast 2007-12-28 Fixed return value check in proxy_connect(), since on some systems
Wilmer van der Gaast 2007-12-28 Added missing return in jabber_login().
Wilmer van der Gaast 2007-12-16 Implemented XEP-0199 (patch from misc@…).
Wilmer van der Gaast 2007-12-12 Checking conn->xcred before trying to clean it up since GnuTLS doesn't
Wilmer van der Gaast 2007-12-12 Killed the <server> parameter to "account add" and changed the default
Wilmer van der Gaast 2007-12-12 Fixed sockerr_again() usage in Jabber module to (hopefully) fix a 100% CPU
Wilmer van der Gaast 2007-12-10 Don't allow nicks that start with a number.
Wilmer van der Gaast 2007-12-10 Fixed "set xxx" syntax (it showed all settings instead of just xxx).
Wilmer van der Gaast 2007-12-09 If I keep forgetting to credit people in commit msgs I should probably add
Wilmer van der Gaast 2007-12-09 Added /invite support for Jabber chatrooms (and fixed the argument order

  • Property mode set to 100644
File size: 4.1 KB
Line 
1  /********************************************************************\
2  * BitlBee -- An IRC to other IM-networks gateway                     *
3  *                                                                    *
4  * Copyright 2002-2004 Wilmer van der Gaast and others                *
5  \********************************************************************/
6
7/* The big hairy IRCd part of the project                               */
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#ifndef _IRC_H
27#define _IRC_H
28
29#define IRC_MAX_LINE 512
30#define IRC_MAX_ARGS 8
31
32#define IRC_LOGIN_TIMEOUT 60
33#define IRC_PING_STRING "PinglBee"
34
35#define UMODES "abisw"
36#define UMODES_PRIV "Ro"
37#define CMODES "nt"
38#define CMODE "t"
39#define UMODE "s"
40
41typedef enum
42{
43        USTATUS_OFFLINE = 0,
44        USTATUS_AUTHORIZED = 1,
45        USTATUS_LOGGED_IN = 2,
46        USTATUS_IDENTIFIED = 4,
47        USTATUS_SHUTDOWN = 8
48} irc_status_t;
49
50typedef struct channel
51{
52        char *name;
53} channel_t;
54
55typedef struct irc
56{
57        int fd;
58        irc_status_t status;
59        double last_pong;
60        int pinging;
61        char *sendbuffer;
62        char *readbuffer;
63
64        int sentbytes;
65        time_t oldtime;
66
67        char *nick;
68        char *user;
69        char *host;
70        char *realname;
71        char *password;
72
73        char umode[8];
74       
75        char *myhost;
76        char *mynick;
77
78        char *channel;
79        int c_id;
80
81        char is_private;                /* Not too nice... */
82        char *last_target;
83       
84        struct query *queries;
85        struct account *accounts;
86        GSList *file_transfers;
87       
88        struct __USER *users;
89        GHashTable *userhash;
90        GHashTable *watches;
91        struct __NICK *nicks;
92        struct set *set;
93
94        gint r_watch_source_id;
95        gint w_watch_source_id;
96        gint ping_source_id;
97} irc_t;
98
99#include "user.h"
100// #include "nick.h"
101
102extern GSList *irc_connection_list;
103
104irc_t *irc_new( int fd );
105void irc_abort( irc_t *irc, int immed, char *format, ... ) G_GNUC_PRINTF( 3, 4 );
106void irc_free( irc_t *irc );
107
108void irc_exec( irc_t *irc, char **cmd );
109void irc_process( irc_t *irc );
110char **irc_parse_line( char *line );
111char *irc_build_line( char **cmd );
112
113void irc_vawrite( irc_t *irc, char *format, va_list params );
114void irc_write( irc_t *irc, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
115void irc_write_all( int now, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
116void irc_reply( irc_t *irc, int code, char *format, ... ) G_GNUC_PRINTF( 3, 4 );
117G_MODULE_EXPORT int irc_usermsg( irc_t *irc, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
118char **irc_tokenize( char *buffer );
119
120void irc_login( irc_t *irc );
121int irc_check_login( irc_t *irc );
122void irc_motd( irc_t *irc );
123void irc_names( irc_t *irc, char *channel );
124void irc_topic( irc_t *irc, char *channel );
125void irc_umode_set( irc_t *irc, char *s, int allow_priv );
126void irc_who( irc_t *irc, char *channel );
127void irc_spawn( irc_t *irc, user_t *u );
128void irc_join( irc_t *irc, user_t *u, char *channel );
129void irc_part( irc_t *irc, user_t *u, char *channel );
130void irc_kick( irc_t *irc, user_t *u, char *channel, user_t *kicker );
131void irc_kill( irc_t *irc, user_t *u );
132void irc_invite( irc_t *irc, char *nick, char *channel );
133void irc_whois( irc_t *irc, char *nick );
134void irc_setpass( irc_t *irc, const char *pass ); /* USE WITH CAUTION! */
135
136int irc_send( irc_t *irc, char *nick, char *s, int flags );
137int irc_privmsg( irc_t *irc, user_t *u, char *type, char *to, char *prefix, char *msg );
138int irc_msgfrom( irc_t *irc, char *nick, char *msg );
139int irc_noticefrom( irc_t *irc, char *nick, char *msg );
140
141void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags );
142struct groupchat *irc_chat_by_channel( irc_t *irc, char *channel );
143
144#endif
Note: See TracBrowser for help on using the repository browser.