Changes in / [1fdb0a4:3dc6d86]
- Files:
-
- 9 added
- 21 deleted
- 58 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r1fdb0a4 r3dc6d86 10 10 11 11 # Program variables 12 objects = account.o bitlbee.o chat.o dcc.o help.o ipc.o irc.o irc_commands.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) user.o13 headers = account.h bitlbee.h commands.h conf.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h lib/events.h lib/ftutil.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/ft.h protocols/nogaim.h12 objects = account.o bitlbee.o chat.o crypting.o help.o ipc.o irc.o irc_commands.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) user.o 13 headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h lib/events.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/nogaim.h 14 14 subdirs = lib protocols 15 15 … … 82 82 install-dev: 83 83 mkdir -p $(DESTDIR)$(INCLUDEDIR) 84 install -m 0644 config.h $(DESTDIR)$(INCLUDEDIR) 85 for i in $(headers); do install -m 0644 $(SRCDIR)$$i $(DESTDIR)$(INCLUDEDIR); done 84 install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR) 86 85 mkdir -p $(DESTDIR)$(PCDIR) 87 86 install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR) … … 94 93 install-etc: 95 94 mkdir -p $(DESTDIR)$(ETCDIR) 96 install -m 0644 $(SRCDIR)motd.txt $(DESTDIR)$(ETCDIR)/motd.txt97 install -m 0644 $(SRCDIR)bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf95 install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt 96 install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf 98 97 99 98 uninstall-etc: … … 111 110 @$(MAKE) -C $@ $(MAKECMDGOALS) 112 111 113 $(objects): %.o: $(SRCDIR)%.c112 $(objects): %.o: %.c 114 113 @echo '*' Compiling $< 115 114 @$(CC) -c $(CFLAGS) $< -o $@ -
bitlbee.c
r1fdb0a4 r3dc6d86 121 121 } 122 122 123 global.listen_watch_source_id = b_input_add( global.listen_socket, B_EV_IO_READ, bitlbee_io_new_client, NULL );123 global.listen_watch_source_id = b_input_add( global.listen_socket, GAIM_INPUT_READ, bitlbee_io_new_client, NULL ); 124 124 125 125 #ifndef _WIN32 … … 321 321 child->pid = client_pid; 322 322 child->ipc_fd = fds[0]; 323 child->ipc_inpa = b_input_add( child->ipc_fd, B_EV_IO_READ, ipc_master_read, child );323 child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child ); 324 324 child_list = g_slist_append( child_list, child ); 325 325 … … 349 349 /* We can store the IPC fd there now. */ 350 350 global.listen_socket = fds[1]; 351 global.listen_watch_source_id = b_input_add( fds[1], B_EV_IO_READ, ipc_child_read, irc );351 global.listen_watch_source_id = b_input_add( fds[1], GAIM_INPUT_READ, ipc_child_read, irc ); 352 352 353 353 close( fds[0] ); -
bitlbee.h
r1fdb0a4 r3dc6d86 43 43 44 44 #if HAVE_CONFIG_H 45 #include <config.h>45 #include "config.h" 46 46 #endif 47 47 -
conf.c
r1fdb0a4 r3dc6d86 63 63 conf->ping_timeout = 300; 64 64 conf->user = NULL; 65 conf->ft_max_size = SIZE_MAX;66 conf->ft_max_kbps = G_MAXUINT;67 conf->ft_listen = NULL;68 65 conf->protocols = NULL; 69 66 proxytype = 0; … … 318 315 conf->user = g_strdup( ini->value ); 319 316 } 320 else if( g_strcasecmp( ini->key, "ft_max_size" ) == 0 )321 {322 size_t ft_max_size;323 if( sscanf( ini->value, "%zu", &ft_max_size ) != 1 )324 {325 fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value );326 return 0;327 }328 conf->ft_max_size = ft_max_size;329 }330 else if( g_strcasecmp( ini->key, "ft_max_kbps" ) == 0 )331 {332 if( sscanf( ini->value, "%d", &i ) != 1 )333 {334 fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value );335 return 0;336 }337 conf->ft_max_kbps = i;338 }339 else if( g_strcasecmp( ini->key, "ft_listen" ) == 0 )340 {341 g_free( conf->ft_listen );342 conf->ft_listen = g_strdup( ini->value );343 }344 317 else if( g_strcasecmp( ini->key, "protocols" ) == 0 ) 345 318 { -
conf.h
r1fdb0a4 r3dc6d86 50 50 int ping_timeout; 51 51 char *user; 52 size_t ft_max_size;53 int ft_max_kbps;54 char *ft_listen;55 52 char **protocols; 56 53 } conf_t; -
configure
r1fdb0a4 r3dc6d86 27 27 yahoo=1 28 28 twitter=1 29 purple=030 29 31 30 debug=0 … … 69 68 --yahoo=0/1 Disable/enable Yahoo part $yahoo 70 69 --twitter=0/1 Disable/enable Twitter part $twitter 71 72 --purple=0/1 Disable/enable libpurple support $purple73 70 74 71 --debug=0/1 Disable/enable debugging $debug … … 124 121 EOF 125 122 126 srcdir="$(dirname $0)"127 if [ "$srcdir" != "." ]; then128 echo129 echo "configure script run from a different directory. Will create some symlinks..."130 if [ ! -e Makefile -o -L Makefile ]; then131 COPYDIRS="doc lib protocols tests utils"132 mkdir -p $(cd "$srcdir"; find $COPYDIRS -type d)133 find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null134 dst="$PWD"135 cd "$srcdir"136 for i in $(find . -name Makefile -type f); do137 ln -s "$PWD${i#.}" "$dst/$i";138 done139 cd "$dst"140 rm -rf .bzr141 fi142 143 echo "SRCDIR=$srcdir/" >> Makefile.settings144 CFLAGS="$CFLAGS -I${dst}"145 else146 srcdir=$PWD147 fi148 149 123 cat<<EOF>config.h 150 124 /* BitlBee settings, generated by configure … … 184 158 185 159 echo CFLAGS=$CFLAGS >> Makefile.settings 186 echo CFLAGS+=-I ${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings160 echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings 187 161 188 162 echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings … … 424 398 fi 425 399 426 STORAGES=" xml"400 STORAGES="text xml" 427 401 428 402 if [ "$ldap" = "auto" ]; then … … 534 508 protoobjs='' 535 509 536 if [ "$purple" = 0 ]; then537 echo '#undef WITH_PURPLE' >> config.h538 else539 if ! $PKG_CONFIG purple; then540 echo541 echo 'Cannot find libpurple development libraries, aborting. (Install libpurple-dev?)'542 exit 1543 fi544 echo '#define WITH_PURPLE' >> config.h545 cat<<EOF>>Makefile.settings546 EFLAGS += $($PKG_CONFIG purple --libs)547 PURPLE_CFLAGS += $($PKG_CONFIG purple --cflags)548 EOF549 protocols=$protocols'purple '550 protoobjs=$protoobjs'purple_mod.o '551 552 # Having both libpurple and native IM modules in one binary may553 # do strange things. Let's not do that.554 msn=0555 jabber=0556 oscar=0557 yahoo=0558 twitter=0559 560 if [ "$events" = "libevent" ]; then561 echo562 echo 'Warning: Some libpurple modules (including msn-pecan) do their event handling'563 echo 'outside libpurple, talking to GLib directly. At least for now the combination'564 echo 'libpurple + libevent is *not* recommended!'565 fi566 fi567 568 510 if [ "$msn" = 0 ]; then 569 511 echo '#undef WITH_MSN' >> config.h -
debian/bitlbee.init
-
Property
mode
changed from
100644
to100755
-
Property
mode
changed from
-
debian/changelog
r1fdb0a4 r3dc6d86 1 bitlbee (1.3-0) unstable; urgency=low2 3 * Setting some bogus version number, fix that later.4 * Now using debhelper to improve maintainability.5 * Added a bitlbee-libpurple package, and split off docs and stuff into6 bitlbee-common.7 8 -- Wilmer van der Gaast <wilmer@gaast.net> Sat, 05 Jun 2010 15:16:38 +01009 10 1 bitlbee (1.2.7-1) unstable; urgency=high 11 2 -
debian/control
r1fdb0a4 r3dc6d86 4 4 Maintainer: Wilmer van der Gaast <wilmer@gaast.net> 5 5 Uploaders: Jelmer Vernooij <jelmer@samba.org> 6 Standards-Version: 3.8. 47 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), po-debconf, libpurple-dev, debhelper (>= 7)6 Standards-Version: 3.8.0 7 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), debconf-2.0, po-debconf 8 8 Homepage: http://www.bitlbee.org/ 9 9 Vcs-Bzr: http://code.bitlbee.org/bitlbee/ … … 12 12 Package: bitlbee 13 13 Architecture: any 14 Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${bee:Version}) 15 Conflicts: bitlbee-libpurple 16 Replaces: bitlbee-libpurple 17 Description: An IRC to other chat networks gateway (default version) 14 Depends: ${shlibs:Depends}, adduser, net-tools, ${debconf-depends}, debianutils (>= 1.16) 15 Description: An IRC to other chat networks gateway 18 16 This program can be used as an IRC server which forwards everything you 19 17 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and 20 18 Twitter. 21 19 22 Package: bitlbee-libpurple23 Architecture: any24 Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${bee:Version})25 Conflicts: bitlbee26 Replaces: bitlbee27 Description: An IRC to other chat networks gateway (using libpurple)28 This program can be used as an IRC server which forwards everything you29 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and30 Twitter.31 .32 This package contains a version of BitlBee that uses the libpurple instant33 messaging library instead of built-in code, which adds support for more IM34 protocols (all protocols supported by Pidgin/Finch) and features (like file35 transfers), at the price of being less lightweight.36 .37 This variant may not be very suitable for BitlBee instances used by many38 (tens or hundreds) of clients.39 40 Package: bitlbee-common41 Architecture: all42 Depends: ${misc:Depends}, net-tools43 Replaces: bitlbee44 Description: An IRC to other chat networks gateway (common files/docs)45 This program can be used as an IRC server which forwards everything you46 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and47 Twitter.48 .49 This package contains common files (mostly documentation) for bitlbee and50 bitlbee-libpurple.51 52 20 Package: bitlbee-dev 53 21 Architecture: all 54 Depends: ${misc:Depends}, bitlbee (>= ${bee:Version}), bitlbee (<< ${bee:Version}.1~)55 Description: An IRC to other chat networks gateway (dev files)22 Depends: bitlbee (>= ${source:Version}), bitlbee (<< ${source:Version}.1~) 23 Description: An IRC to other chat networks gateway 56 24 This program can be used as an IRC server which forwards everything you 57 25 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and -
debian/patches/bitlbee.conf.diff
r1fdb0a4 r3dc6d86 1 --- bitlbee.conf 2009-06-01 00:20:24.000000000 +01002 +++ bitlbee.conf 2009-06-07 21:16:19.000000000 +01001 --- debian/bitlbee/etc/bitlbee/bitlbee.conf 2009-06-01 00:20:24.000000000 +0100 2 +++ debian/bitlbee/etc/bitlbee/bitlbee.conf 2009-06-07 21:16:19.000000000 +0100 3 3 @@ -23,13 +23,18 @@ 4 4 ## If BitlBee is started by root as a daemon, it can drop root privileges, -
debian/po/POTFILES.in
r1fdb0a4 r3dc6d86 1 [type: gettext/rfc822deb] bitlbee-common.templates1 [type: gettext/rfc822deb] templates -
debian/rules
r1fdb0a4 r3dc6d86 1 1 #!/usr/bin/make -f 2 #3 # Finally switching to debhelper.4 #5 # Not using debhelper was an exercise suggested to me by my AM (Gergely6 # Nagy). It was educating at the time but I finally decided that the7 # exercise is over now.8 #9 2 10 BITLBEE_CONFIGURE_FLAGS ?=11 3 DEBUG ?= 0 12 4 13 ifndef BITLBEE_VERSION 5 ifdef BITLBEE_VERSION 6 BITLBEE_FORCE_VERSION=1 7 else 14 8 # Want to use the full package version number instead of just the release. 15 BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\" 9 BITLBEE_VERSION ?= "$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')" 10 export BITLBEE_VERSION 16 11 endif 17 12 18 build: build-stamp 19 build-stamp: 20 dh_testdir 21 22 mkdir -p debian/build-native 23 ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS) 24 $(MAKE) -C debian/build-native 25 26 mkdir -p debian/build-libpurple 27 ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) 28 $(MAKE) -C debian/build-libpurple 29 30 touch build-stamp 13 build-arch: build-arch-stamp 14 build-arch-stamp: 15 [ -d debian ] 16 ./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent 17 $(MAKE) 18 # $(MAKE) -C doc/ all 19 touch build-arch-stamp 31 20 32 21 clean: 33 dh_testdir 34 dh_testroot 35 rm -f build-stamp 22 [ "`whoami`" = "root" -a -d debian ] 23 rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files debian/bitlbee-dev 24 $(MAKE) distclean 25 # -$(MAKE) -C doc/ clean 26 36 27 37 rm -rf build-arch-stamp debian/build-* 38 $(MAKE) distclean 28 install-arch: build-arch 29 [ "`whoami`" = "root" -a -d debian ] 30 mkdir -p debian/bitlbee/DEBIAN/ 31 $(MAKE) install install-etc DESTDIR=`pwd`/debian/bitlbee 39 32 40 dh_clean 33 mkdir -p debian/bitlbee/usr/share/doc/bitlbee/ 34 cp doc/user-guide/user-guide.txt debian/bitlbee/usr/share/doc/bitlbee/ 35 cp doc/user-guide/user-guide.html debian/bitlbee/usr/share/doc/bitlbee/ 41 36 42 install: build 43 dh_testdir 44 dh_testroot 45 dh_prep 46 dh_installdirs 37 install-indep: install-arch 38 [ "`whoami`" = "root" -a -d debian ] 39 mkdir -p debian/bitlbee-dev/DEBIAN/ 40 $(MAKE) install-dev DESTDIR=`pwd`/debian/bitlbee-dev 47 41 48 $(MAKE) -C debian/build-native install install-etc DESTDIR=`pwd`/debian/bitlbee 49 $(MAKE) -C debian/build-libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple 50 $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev 42 mkdir -p debian/bitlbee-dev/usr/share/doc/bitlbee-dev/ 51 43 52 patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff 53 patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff44 binary-arch: build-arch install-arch 45 [ "`whoami`" = "root" -a -d debian ] 54 46 55 mkdir -p debian/bitlbee-common/usr 56 mv debian/bitlbee/usr/share debian/bitlbee-common/usr 57 rm -rf debian/bitlbee-libpurple/usr/share 47 chmod 755 debian/post* debian/pre* debian/config debian/bitlbee.init 58 48 59 binary-common: 60 dh_testdir 61 dh_testroot 49 mkdir -p debian/bitlbee/usr/share/doc/bitlbee/examples/ debian/bitlbee/etc/init.d/ 50 -cp doc/RELEASE-SPEECH* debian/bitlbee/usr/share/doc/bitlbee/ && gzip -9 debian/bitlbee/usr/share/doc/bitlbee/RELEASE-SPEECH* 51 cp doc/CREDITS doc/AUTHORS doc/README doc/FAQ debian/README.Debian debian/bitlbee/usr/share/doc/bitlbee/ 52 cp debian/changelog debian/bitlbee/usr/share/doc/bitlbee/changelog.Debian 53 cp debian/copyright debian/bitlbee/usr/share/doc/bitlbee/copyright 54 cp doc/CHANGES debian/bitlbee/usr/share/doc/bitlbee/changelog 55 cp utils/* debian/bitlbee/usr/share/doc/bitlbee/examples/ 56 cp debian/bitlbee.init debian/bitlbee/etc/init.d/bitlbee 57 patch -p0 < debian/patches/bitlbee.conf.diff 58 cd debian/bitlbee/usr/share/; \ 59 gzip -9 doc/bitlbee/changelog.Debian doc/bitlbee/changelog doc/bitlbee/user-guide.txt \ 60 doc/bitlbee/examples/* man/man8/bitlbee.8 man/man5/bitlbee.conf.5 61 62 chown -R root:root debian/bitlbee/ 63 find debian/bitlbee/usr/share/ -type d -exec chmod 755 {} \; 64 find debian/bitlbee/usr/share/ -type f -exec chmod 644 {} \; 65 66 cp debian/prerm debian/bitlbee/DEBIAN/ 67 cp debian/postinst debian/bitlbee/DEBIAN/ 68 cp debian/postrm debian/bitlbee/DEBIAN/ 69 cp debian/config debian/bitlbee/DEBIAN/ 62 70 63 dh_installdocs --link-doc=bitlbee-common 64 dh_installchangelogs doc/CHANGES 65 dh_installexamples 66 dh_installdebconf 67 dh_installinit 68 ifeq ($(DH_OPTIONS),-a) 69 cp -a debian/bitlbee/etc debian/bitlbee-libpurple 71 po2debconf debian/templates > debian/bitlbee/DEBIAN/templates 72 cp debian/conffiles debian/bitlbee/DEBIAN/ 73 74 if [ "$(DEBUG)" = "0" ]; then strip -R .comment -R .note debian/bitlbee/usr/sbin/bitlbee; fi 75 76 cd debian/bitlbee; \ 77 find usr -type f -exec md5sum {} \; > DEBIAN/md5sums 78 dpkg-shlibdeps -Tdebian/bitlbee.substvars -dDepends debian/bitlbee/usr/sbin/bitlbee 79 ifdef BITLBEE_FORCE_VERSION 80 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -v1:$(BITLBEE_VERSION)-0 -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0' 81 else 82 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0' 70 83 endif 71 dh_installman 72 dh_strip 73 dh_link 74 dh_compress 75 dh_fixperms 76 dh_installdeb 77 ifeq ($(DH_OPTIONS),-a) 78 cp -a debian/bitlbee/DEBIAN/{post,pre}* debian/bitlbee-libpurple/DEBIAN 84 85 dpkg --build debian/bitlbee .. 86 87 binary-indep: install-indep 88 [ "`whoami`" = "root" -a -d debian ] 89 90 chown -R root.root debian/bitlbee-dev/ 91 find debian/bitlbee-dev/usr/share/ -type d -exec chmod 755 {} \; 92 find debian/bitlbee-dev/usr/share/ -type f -exec chmod 644 {} \; 93 94 cp debian/changelog debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian 95 gzip -9 debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian 96 cp debian/copyright debian/bitlbee-dev/usr/share/doc/bitlbee-dev/copyright 97 98 cd debian/bitlbee-dev; \ 99 find usr -type f -exec md5sum {} \; > DEBIAN/md5sums 100 101 ifdef BITLBEE_FORCE_VERSION 102 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev -v1:$(BITLBEE_VERSION)-0 103 else 104 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev 79 105 endif 80 dh_shlibdeps81 ifdef BITLBEE_VERSION82 echo source:Version=1:$(BITLBEE_VERSION)-0 > debian/substvars83 dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 -Vbee:Version=1:$(BITLBEE_VERSION)-084 else85 dh_gencontrol -- -Vbee:Version=$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}' | sed -e 's/+[^+]*$$//')86 endif87 dh_md5sums88 dh_builddeb89 106 90 binary-indep: build install 91 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common 107 dpkg --build debian/bitlbee-dev .. 92 108 93 binary-arch: build install 94 $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common 109 binary: binary-arch binary-indep 110 build: build-arch 111 install: install-arch install-indep 95 112 96 binary-%: build install 97 make -f debian/rules binary-common DH_OPTIONS=-p$* 98 99 binary: binary-indep binary-arch 100 .PHONY: build clean binary-indep binary-arch binary-common binary install 113 .PHONY: build-arch build clean binary-arch binary install-arch install binary-indep install-indep -
doc/Makefile
r1fdb0a4 r3dc6d86 1 1 -include ../Makefile.settings 2 ifdef SRCDIR3 SRCDIR := $(SRCDIR)doc/4 endif5 2 6 3 all: … … 10 7 install: 11 8 mkdir -p $(DESTDIR)$(MANDIR)/man8/ $(DESTDIR)$(MANDIR)/man5/ 12 install -m 0644 $(SRCDIR)bitlbee.8 $(DESTDIR)$(MANDIR)/man8/13 install -m 0644 $(SRCDIR)bitlbee.conf.5 $(DESTDIR)$(MANDIR)/man5/9 install -m 0644 bitlbee.8 $(DESTDIR)$(MANDIR)/man8/ 10 install -m 0644 bitlbee.conf.5 $(DESTDIR)$(MANDIR)/man5/ 14 11 $(MAKE) -C user-guide $@ 15 12 -
doc/user-guide/Makefile
r1fdb0a4 r3dc6d86 1 1 -include ../../Makefile.settings 2 ifdef SRCDIR3 SRCDIR := $(SRCDIR)doc/user-guide/4 endif5 6 2 EXTRAPARANEWLINE = 1 7 3 # EXTRAPARANEWLINE = 0 … … 42 38 chmod 0755 $(DESTDIR)$(DATADIR) 43 39 rm -f $(DESTDIR)$(DATADIR)/help.txt # Prevent help function from breaking in running sessions 44 install -m 0644 $(SRCDIR)help.txt $(DESTDIR)$(DATADIR)/help.txt40 install -m 0644 help.txt $(DESTDIR)$(DATADIR)/help.txt 45 41 46 42 uninstall: -
doc/user-guide/commands.xml
r1fdb0a4 r3dc6d86 1168 1168 1169 1169 </bitlbee-command> 1170 1171 <bitlbee-command name="transfers">1172 <short-description>Monitor, cancel, or reject file transfers</short-description>1173 <syntax>transfers [<cancel> id | <reject>]</syntax>1174 1175 <description>1176 <para>1177 Without parameters the currently pending file transfers and their status will be listed. Available actions are <emphasis>cancel</emphasis> and <emphasis>reject</emphasis>. See <emphasis>help transfers <action></emphasis> for more information.1178 </para>1179 1180 <ircexample>1181 <ircline nick="ulim">transfers</ircline>1182 </ircexample>1183 </description>1184 1185 <bitlbee-command name="cancel">1186 <short-description>Cancels the file transfer with the given id</short-description>1187 <syntax>transfers <cancel> id</syntax>1188 1189 <description>1190 <para>Cancels the file transfer with the given id</para>1191 </description>1192 1193 <ircexample>1194 <ircline nick="ulim">transfers cancel 1</ircline>1195 <ircline nick="root">Canceling file transfer for test</ircline>1196 </ircexample>1197 </bitlbee-command>1198 1199 <bitlbee-command name="reject">1200 <short-description>Rejects all incoming transfers</short-description>1201 <syntax>transfers <reject></syntax>1202 1203 <description>1204 <para>Rejects all incoming (not already transferring) file transfers. Since you probably have only one incoming transfer at a time, no id is neccessary. Or is it?</para>1205 </description>1206 1207 <ircexample>1208 <ircline nick="ulim">transfers reject</ircline>1209 </ircexample>1210 </bitlbee-command>1211 </bitlbee-command>1212 1213 1170 </chapter> -
help.c
r1fdb0a4 r3dc6d86 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * 4 * Copyright 2002-200 9Wilmer van der Gaast and others *4 * Copyright 2002-2005 Wilmer van der Gaast and others * 5 5 \********************************************************************/ 6 6 … … 169 169 return NULL; 170 170 } 171 172 int help_add_mem( help_t **help, const char *title, const char *content )173 {174 help_t *h, *l = NULL;175 176 for( h = *help; h; h = h->next )177 {178 if( g_strcasecmp( h->title, title ) == 0 )179 return 0;180 181 l = h;182 }183 184 if( l )185 h = l->next = g_new0( struct help, 1 );186 else187 *help = h = g_new0( struct help, 1 );188 h->fd = -1;189 h->title = g_strdup( title );190 h->length = strlen( content );191 h->offset.mem_offset = g_strdup( content );192 193 return 1;194 } -
help.h
r1fdb0a4 r3dc6d86 46 46 void help_free( help_t **help ); 47 47 char *help_get( help_t **help, char *title ); 48 int help_add_mem( help_t **help, const char *title, const char *content_ );49 48 50 49 #endif -
ipc.c
r1fdb0a4 r3dc6d86 514 514 } 515 515 516 child->ipc_inpa = b_input_add( child->ipc_fd, B_EV_IO_READ, ipc_master_read, child );516 child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child ); 517 517 518 518 child_list = g_slist_append( child_list, child ); … … 552 552 } 553 553 554 b_input_add( serversock, B_EV_IO_READ, new_ipc_client, NULL );554 b_input_add( serversock, GAIM_INPUT_READ, new_ipc_client, NULL ); 555 555 556 556 return 1; … … 597 597 return 0; 598 598 } 599 child->ipc_inpa = b_input_add( child->ipc_fd, B_EV_IO_READ, ipc_master_read, child );599 child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child ); 600 600 601 601 child_list = g_slist_append( child_list, child ); -
irc.c
r1fdb0a4 r3dc6d86 27 27 #include "bitlbee.h" 28 28 #include "sock.h" 29 #include "crypting.h" 29 30 #include "ipc.h" 30 #include "dcc.h"31 31 32 32 static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond ); … … 125 125 sock_make_nonblocking( irc->fd ); 126 126 127 irc->r_watch_source_id = b_input_add( irc->fd, B_EV_IO_READ, bitlbee_io_current_client_read, irc );127 irc->r_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_READ, bitlbee_io_current_client_read, irc ); 128 128 129 129 irc->status = USTATUS_OFFLINE; … … 214 214 /* Evaluator sets the iconv/oconv structures. */ 215 215 set_eval_charset( set_find( &irc->set, "charset" ), set_getstr( &irc->set, "charset" ) ); 216 217 nogaim_init();218 216 219 217 return( irc ); … … 698 696 in the event queue. */ 699 697 /* Really can't be done as long as the code doesn't do error checking very well: 700 if( bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE ) ) */698 if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) ) */ 701 699 702 700 /* So just always do it via the event handler. */ 703 irc->w_watch_source_id = b_input_add( irc->fd, B_EV_IO_WRITE, bitlbee_io_current_client_write, irc );701 irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc ); 704 702 } 705 703 … … 727 725 if( now ) 728 726 { 729 bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE );727 bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ); 730 728 } 731 729 temp = temp->next; … … 1128 1126 return( 1 ); 1129 1127 } 1130 else if( g_strncasecmp( s + 1, "DCC", 3 ) == 0 )1131 {1132 if( u && u->ic && u->ic->acc->prpl->transfer_request )1133 {1134 file_transfer_t *ft = dcc_request( u->ic, s + 5 );1135 if ( ft )1136 u->ic->acc->prpl->transfer_request( u->ic, ft, u->handle );1137 }1138 return( 1 );1139 }1140 1128 else 1141 1129 { 1142 irc_usermsg( irc, " Supported CTCPs are ACTION, VERSION, PING, TYPING, DCC" );1130 irc_usermsg( irc, "Non-ACTION CTCP's aren't supported" ); 1143 1131 return( 0 ); 1144 1132 } -
irc.h
r1fdb0a4 r3dc6d86 83 83 struct query *queries; 84 84 struct account *accounts; 85 GSList *file_transfers;86 85 struct chat *chatrooms; 87 86 -
lib/Makefile
r1fdb0a4 r3dc6d86 8 8 9 9 -include ../Makefile.settings 10 ifdef SRCDIR11 SRCDIR := $(SRCDIR)lib/12 endif13 10 14 11 # [SH] Program variables 15 objects = arc.o base64.o $(EVENT_HANDLER) ftutil.ohttp_client.o ini.o md5.o misc.o oauth.o proxy.o sha1.o $(SSL_CLIENT) url.o xmltree.o12 objects = arc.o base64.o $(EVENT_HANDLER) http_client.o ini.o md5.o misc.o oauth.o proxy.o sha1.o $(SSL_CLIENT) url.o xmltree.o 16 13 17 14 CFLAGS += -Wall … … 40 37 $(objects): ../Makefile.settings Makefile 41 38 42 $(objects): %.o: $(SRCDIR)%.c39 $(objects): %.o: %.c 43 40 @echo '*' Compiling $< 44 41 @$(CC) -c $(CFLAGS) $< -o $@ -
lib/events.h
r1fdb0a4 r3dc6d86 48 48 the given callback function. */ 49 49 typedef enum { 50 B_EV_IO_READ = 1 << 0, 51 B_EV_IO_WRITE = 1 << 1, 52 B_EV_FLAG_FORCE_ONCE = 1 << 16, 53 B_EV_FLAG_FORCE_REPEAT = 1 << 17, 50 GAIM_INPUT_READ = 1 << 1, 51 GAIM_INPUT_WRITE = 1 << 2 54 52 } b_input_condition; 55 53 typedef gboolean (*b_event_handler)(gpointer data, gint fd, b_input_condition cond); -
lib/events_glib.c
r1fdb0a4 r3dc6d86 49 49 b_event_handler function; 50 50 gpointer data; 51 guint flags;52 51 } GaimIOClosure; 53 52 … … 77 76 78 77 if (condition & GAIM_READ_COND) 79 gaim_cond |= B_EV_IO_READ;78 gaim_cond |= GAIM_INPUT_READ; 80 79 if (condition & GAIM_WRITE_COND) 81 gaim_cond |= B_EV_IO_WRITE;80 gaim_cond |= GAIM_INPUT_WRITE; 82 81 83 82 event_debug( "gaim_io_invoke( %d, %d, 0x%x )\n", g_io_channel_unix_get_fd(source), condition, data ); … … 88 87 event_debug( "Returned FALSE, cancelling.\n" ); 89 88 90 if (closure->flags & B_EV_FLAG_FORCE_ONCE) 91 return FALSE; 92 else if (closure->flags & B_EV_FLAG_FORCE_REPEAT) 93 return TRUE; 94 else 95 return st; 89 return st; 96 90 } 97 91 … … 111 105 closure->function = function; 112 106 closure->data = data; 113 closure->flags = condition;114 107 115 if (condition & B_EV_IO_READ)108 if (condition & GAIM_INPUT_READ) 116 109 cond |= GAIM_READ_COND; 117 if (condition & B_EV_IO_WRITE)110 if (condition & GAIM_INPUT_WRITE) 118 111 cond |= GAIM_WRITE_COND; 119 112 -
lib/events_libevent.c
r1fdb0a4 r3dc6d86 60 60 b_event_handler function; 61 61 void *data; 62 guint flags;63 62 }; 64 63 … … 127 126 { 128 127 if( event & EV_READ ) 129 cond |= B_EV_IO_READ;128 cond |= GAIM_INPUT_READ; 130 129 if( event & EV_WRITE ) 131 cond |= B_EV_IO_WRITE;130 cond |= GAIM_INPUT_WRITE; 132 131 } 133 132 … … 151 150 return; 152 151 } 153 else if( !st && !( b_ev->flags & B_EV_FLAG_FORCE_REPEAT ))152 else if( !st ) 154 153 { 155 154 event_debug( "Handler returned FALSE: " ); … … 175 174 event_debug( "b_input_add( %d, %d, 0x%x, 0x%x ) ", fd, condition, function, data ); 176 175 177 if( ( condition & B_EV_IO_READ && ( b_ev = g_hash_table_lookup( read_hash, &fd ) ) ) ||178 ( condition & B_EV_IO_WRITE && ( b_ev = g_hash_table_lookup( write_hash, &fd ) ) ) )176 if( ( condition & GAIM_INPUT_READ && ( b_ev = g_hash_table_lookup( read_hash, &fd ) ) ) || 177 ( condition & GAIM_INPUT_WRITE && ( b_ev = g_hash_table_lookup( write_hash, &fd ) ) ) ) 179 178 { 180 179 /* We'll stick with this libevent entry, but give it a new BitlBee id. */ … … 199 198 200 199 out_cond = EV_PERSIST; 201 if( condition & B_EV_IO_READ )200 if( condition & GAIM_INPUT_READ ) 202 201 out_cond |= EV_READ; 203 if( condition & B_EV_IO_WRITE )202 if( condition & GAIM_INPUT_WRITE ) 204 203 out_cond |= EV_WRITE; 205 204 … … 213 212 } 214 213 215 b_ev->flags = condition;216 214 g_hash_table_insert( id_hash, &b_ev->id, b_ev ); 217 215 return b_ev->id; -
lib/http_client.c
r1fdb0a4 r3dc6d86 149 149 if( req->bytes_written < req->request_length ) 150 150 req->inpa = b_input_add( source, 151 req->ssl ? ssl_getdirection( req->ssl ) : B_EV_IO_WRITE,151 req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_WRITE, 152 152 http_connected, req ); 153 153 else 154 req->inpa = b_input_add( source, B_EV_IO_READ, http_incoming_data, req );154 req->inpa = b_input_add( source, GAIM_INPUT_READ, http_incoming_data, req ); 155 155 156 156 return FALSE; … … 234 234 /* There will be more! */ 235 235 req->inpa = b_input_add( req->fd, 236 req->ssl ? ssl_getdirection( req->ssl ) : B_EV_IO_READ,236 req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_READ, 237 237 http_incoming_data, req ); 238 238 -
lib/proxy.c
r1fdb0a4 r3dc6d86 91 91 b_event_remove(phb->inpa); 92 92 if( phb->proxy_func ) 93 phb->proxy_func(phb->proxy_data, -1, B_EV_IO_READ);93 phb->proxy_func(phb->proxy_data, -1, GAIM_INPUT_READ); 94 94 else { 95 phb->func(phb->data, -1, B_EV_IO_READ);95 phb->func(phb->data, -1, GAIM_INPUT_READ); 96 96 g_free(phb); 97 97 } … … 102 102 b_event_remove(phb->inpa); 103 103 if( phb->proxy_func ) 104 phb->proxy_func(phb->proxy_data, source, B_EV_IO_READ);104 phb->proxy_func(phb->proxy_data, source, GAIM_INPUT_READ); 105 105 else { 106 phb->func(phb->data, source, B_EV_IO_READ);106 phb->func(phb->data, source, GAIM_INPUT_READ); 107 107 g_free(phb); 108 108 } … … 147 147 return -1; 148 148 } else { 149 phb->inpa = b_input_add(fd, B_EV_IO_WRITE, gaim_io_connected, phb);149 phb->inpa = b_input_add(fd, GAIM_INPUT_WRITE, gaim_io_connected, phb); 150 150 phb->fd = fd; 151 151 … … 179 179 if ((memcmp(HTTP_GOODSTRING, inputline, strlen(HTTP_GOODSTRING)) == 0) || 180 180 (memcmp(HTTP_GOODSTRING2, inputline, strlen(HTTP_GOODSTRING2)) == 0)) { 181 phb->func(phb->data, source, B_EV_IO_READ);181 phb->func(phb->data, source, GAIM_INPUT_READ); 182 182 g_free(phb->host); 183 183 g_free(phb); … … 186 186 187 187 close(source); 188 phb->func(phb->data, -1, B_EV_IO_READ);188 phb->func(phb->data, -1, GAIM_INPUT_READ); 189 189 g_free(phb->host); 190 190 g_free(phb); … … 204 204 if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { 205 205 close(source); 206 phb->func(phb->data, -1, B_EV_IO_READ);206 phb->func(phb->data, -1, GAIM_INPUT_READ); 207 207 g_free(phb->host); 208 208 g_free(phb); … … 215 215 if (send(source, cmd, strlen(cmd), 0) < 0) { 216 216 close(source); 217 phb->func(phb->data, -1, B_EV_IO_READ);217 phb->func(phb->data, -1, GAIM_INPUT_READ); 218 218 g_free(phb->host); 219 219 g_free(phb); … … 230 230 if (send(source, cmd, strlen(cmd), 0) < 0) { 231 231 close(source); 232 phb->func(phb->data, -1, B_EV_IO_READ);232 phb->func(phb->data, -1, GAIM_INPUT_READ); 233 233 g_free(phb->host); 234 234 g_free(phb); … … 240 240 if (send(source, cmd, strlen(cmd), 0) < 0) { 241 241 close(source); 242 phb->func(phb->data, -1, B_EV_IO_READ);243 g_free(phb->host); 244 g_free(phb); 245 return FALSE; 246 } 247 248 phb->inpa = b_input_add(source, B_EV_IO_READ, http_canread, phb);242 phb->func(phb->data, -1, GAIM_INPUT_READ); 243 g_free(phb->host); 244 g_free(phb); 245 return FALSE; 246 } 247 248 phb->inpa = b_input_add(source, GAIM_INPUT_READ, http_canread, phb); 249 249 250 250 return FALSE; … … 273 273 memset(packet, 0, sizeof(packet)); 274 274 if (read(source, packet, 9) >= 4 && packet[1] == 90) { 275 phb->func(phb->data, source, B_EV_IO_READ);275 phb->func(phb->data, source, GAIM_INPUT_READ); 276 276 g_free(phb->host); 277 277 g_free(phb); … … 280 280 281 281 close(source); 282 phb->func(phb->data, -1, B_EV_IO_READ);282 phb->func(phb->data, -1, GAIM_INPUT_READ); 283 283 g_free(phb->host); 284 284 g_free(phb); … … 299 299 if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { 300 300 close(source); 301 phb->func(phb->data, -1, B_EV_IO_READ);301 phb->func(phb->data, -1, GAIM_INPUT_READ); 302 302 g_free(phb->host); 303 303 g_free(phb); … … 309 309 if (!(hp = gethostbyname(phb->host))) { 310 310 close(source); 311 phb->func(phb->data, -1, B_EV_IO_READ);311 phb->func(phb->data, -1, GAIM_INPUT_READ); 312 312 g_free(phb->host); 313 313 g_free(phb); … … 326 326 if (write(source, packet, 9) != 9) { 327 327 close(source); 328 phb->func(phb->data, -1, B_EV_IO_READ);329 g_free(phb->host); 330 g_free(phb); 331 return FALSE; 332 } 333 334 phb->inpa = b_input_add(source, B_EV_IO_READ, s4_canread, phb);328 phb->func(phb->data, -1, GAIM_INPUT_READ); 329 g_free(phb->host); 330 g_free(phb); 331 return FALSE; 332 } 333 334 phb->inpa = b_input_add(source, GAIM_INPUT_READ, s4_canread, phb); 335 335 336 336 return FALSE; … … 359 359 if (read(source, buf, 10) < 10) { 360 360 close(source); 361 phb->func(phb->data, -1, B_EV_IO_READ);361 phb->func(phb->data, -1, GAIM_INPUT_READ); 362 362 g_free(phb->host); 363 363 g_free(phb); … … 366 366 if ((buf[0] != 0x05) || (buf[1] != 0x00)) { 367 367 close(source); 368 phb->func(phb->data, -1, B_EV_IO_READ);369 g_free(phb->host); 370 g_free(phb); 371 return FALSE; 372 } 373 374 phb->func(phb->data, source, B_EV_IO_READ);368 phb->func(phb->data, -1, GAIM_INPUT_READ); 369 g_free(phb->host); 370 g_free(phb); 371 return FALSE; 372 } 373 374 phb->func(phb->data, source, GAIM_INPUT_READ); 375 375 g_free(phb->host); 376 376 g_free(phb); … … 396 396 if (write(source, buf, (5 + strlen(phb->host) + 2)) < (5 + strlen(phb->host) + 2)) { 397 397 close(source); 398 phb->func(phb->data, -1, B_EV_IO_READ);398 phb->func(phb->data, -1, GAIM_INPUT_READ); 399 399 g_free(phb->host); 400 400 g_free(phb); … … 402 402 } 403 403 404 phb->inpa = b_input_add(source, B_EV_IO_READ, s5_canread_again, phb);404 phb->inpa = b_input_add(source, GAIM_INPUT_READ, s5_canread_again, phb); 405 405 } 406 406 … … 414 414 if (read(source, buf, 2) < 2) { 415 415 close(source); 416 phb->func(phb->data, -1, B_EV_IO_READ);416 phb->func(phb->data, -1, GAIM_INPUT_READ); 417 417 g_free(phb->host); 418 418 g_free(phb); … … 422 422 if ((buf[0] != 0x01) || (buf[1] != 0x00)) { 423 423 close(source); 424 phb->func(phb->data, -1, B_EV_IO_READ);424 phb->func(phb->data, -1, GAIM_INPUT_READ); 425 425 g_free(phb->host); 426 426 g_free(phb); … … 442 442 if (read(source, buf, 2) < 2) { 443 443 close(source); 444 phb->func(phb->data, -1, B_EV_IO_READ);444 phb->func(phb->data, -1, GAIM_INPUT_READ); 445 445 g_free(phb->host); 446 446 g_free(phb); … … 450 450 if ((buf[0] != 0x05) || (buf[1] == 0xff)) { 451 451 close(source); 452 phb->func(phb->data, -1, B_EV_IO_READ);452 phb->func(phb->data, -1, GAIM_INPUT_READ); 453 453 g_free(phb->host); 454 454 g_free(phb); … … 465 465 if (write(source, buf, 3 + i + j) < 3 + i + j) { 466 466 close(source); 467 phb->func(phb->data, -1, B_EV_IO_READ);467 phb->func(phb->data, -1, GAIM_INPUT_READ); 468 468 g_free(phb->host); 469 469 g_free(phb); … … 471 471 } 472 472 473 phb->inpa = b_input_add(source, B_EV_IO_READ, s5_readauth, phb);473 phb->inpa = b_input_add(source, GAIM_INPUT_READ, s5_readauth, phb); 474 474 } else { 475 475 s5_sendconnect(phb, source); … … 491 491 if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { 492 492 close(source); 493 phb->func(phb->data, -1, B_EV_IO_READ);493 phb->func(phb->data, -1, GAIM_INPUT_READ); 494 494 g_free(phb->host); 495 495 g_free(phb); … … 513 513 if (write(source, buf, i) < i) { 514 514 close(source); 515 phb->func(phb->data, -1, B_EV_IO_READ);516 g_free(phb->host); 517 g_free(phb); 518 return FALSE; 519 } 520 521 phb->inpa = b_input_add(source, B_EV_IO_READ, s5_canread, phb);515 phb->func(phb->data, -1, GAIM_INPUT_READ); 516 g_free(phb->host); 517 g_free(phb); 518 return FALSE; 519 } 520 521 phb->inpa = b_input_add(source, GAIM_INPUT_READ, s5_canread, phb); 522 522 523 523 return FALSE; -
lib/ssl_bogus.c
r1fdb0a4 r3dc6d86 59 59 b_input_condition ssl_getdirection( void *conn ) 60 60 { 61 return B_EV_IO_READ;61 return GAIM_INPUT_READ; 62 62 } 63 63 -
lib/ssl_client.h
r1fdb0a4 r3dc6d86 71 71 G_MODULE_EXPORT int ssl_getfd( void *conn ); 72 72 73 /* This function returns B_EV_IO_READ/WRITE. With SSL connections it's73 /* This function returns GAIM_INPUT_READ/WRITE. With SSL connections it's 74 74 possible that something has to be read while actually were trying to 75 75 write something (think about key exchange/refresh/etc). So when an -
lib/ssl_gnutls.c
r1fdb0a4 r3dc6d86 106 106 struct scd *conn = data; 107 107 108 return ssl_connected( conn, conn->fd, B_EV_IO_WRITE );108 return ssl_connected( conn, conn->fd, GAIM_INPUT_WRITE ); 109 109 } 110 110 … … 244 244 { 245 245 return( gnutls_record_get_direction( ((struct scd*)conn)->session ) ? 246 B_EV_IO_WRITE : B_EV_IO_READ );247 } 246 GAIM_INPUT_WRITE : GAIM_INPUT_READ ); 247 } -
lib/ssl_nss.c
r1fdb0a4 r3dc6d86 193 193 { 194 194 /* Just in case someone calls us, let's return the most likely case: */ 195 return B_EV_IO_READ;195 return GAIM_INPUT_READ; 196 196 } -
lib/ssl_openssl.c
r1fdb0a4 r3dc6d86 102 102 struct scd *conn = data; 103 103 104 return ssl_connected( conn, conn->fd, B_EV_IO_WRITE );104 return ssl_connected( conn, conn->fd, GAIM_INPUT_WRITE ); 105 105 } 106 106 … … 270 270 b_input_condition ssl_getdirection( void *conn ) 271 271 { 272 return( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ? B_EV_IO_WRITE : B_EV_IO_READ );273 } 272 return( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ? GAIM_INPUT_WRITE : GAIM_INPUT_READ ); 273 } -
lib/ssl_sspi.c
r1fdb0a4 r3dc6d86 275 275 GaimInputCondition ssl_getdirection( void *conn ) 276 276 { 277 return B_EV_IO_WRITE; /* FIXME: or B_EV_IO_READ */278 } 277 return GAIM_INPUT_WRITE; /* FIXME: or GAIM_INPUT_READ */ 278 } -
protocols/Makefile
r1fdb0a4 r3dc6d86 8 8 9 9 -include ../Makefile.settings 10 ifdef SRCDIR11 SRCDIR := $(SRCDIR)protocols/12 endif13 10 14 11 # [SH] Program variables … … 52 49 $(objects): ../Makefile.settings Makefile 53 50 54 $(objects): %.o: $(SRCDIR)%.c51 $(objects): %.o: %.c 55 52 @echo '*' Compiling $< 56 53 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/jabber/Makefile
r1fdb0a4 r3dc6d86 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR11 SRCDIR := $(SRCDIR)protocols/jabber/12 endif13 10 14 11 # [SH] Program variables 15 objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o s 5bytestream.o sasl.o si.o12 objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o 16 13 17 14 CFLAGS += -Wall … … 36 33 $(objects): ../../Makefile.settings Makefile 37 34 38 $(objects): %.o: $(SRCDIR)%.c35 $(objects): %.o: %.c 39 36 @echo '*' Compiling $< 40 37 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/jabber/io.c
r1fdb0a4 r3dc6d86 64 64 most cases it probably won't be necessary.) */ 65 65 if( ( ret = jabber_write_queue( ic ) ) && jd->tx_len > 0 ) 66 jd->w_inpa = b_input_add( jd->fd, B_EV_IO_WRITE, jabber_write_callback, ic );66 jd->w_inpa = b_input_add( jd->fd, GAIM_INPUT_WRITE, jabber_write_callback, ic ); 67 67 } 68 68 else … … 504 504 505 505 if( jd->r_inpa <= 0 ) 506 jd->r_inpa = b_input_add( jd->fd, B_EV_IO_READ, jabber_read_callback, ic );506 jd->r_inpa = b_input_add( jd->fd, GAIM_INPUT_READ, jabber_read_callback, ic ); 507 507 508 508 greet = g_strdup_printf( "%s<stream:stream to=\"%s\" xmlns=\"jabber:client\" " -
protocols/jabber/iq.c
r1fdb0a4 r3dc6d86 91 91 pack = 0; 92 92 } 93 else if( strcmp( s, XMLNS_DISCO _INFO) == 0 )94 { 95 const char *features[] = { XMLNS_DISCO _INFO,93 else if( strcmp( s, XMLNS_DISCOVER ) == 0 ) 94 { 95 const char *features[] = { XMLNS_DISCOVER, 96 96 XMLNS_VERSION, 97 97 XMLNS_TIME, … … 99 99 XMLNS_MUC, 100 100 XMLNS_PING, 101 XMLNS_SI,102 XMLNS_BYTESTREAMS,103 XMLNS_FILETRANSFER,104 101 NULL }; 105 102 const char **f; … … 121 118 { 122 119 xt_free_node( reply ); 123 reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" , NULL);120 reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" ); 124 121 pack = 0; 125 122 } … … 127 124 else if( strcmp( type, "set" ) == 0 ) 128 125 { 129 if( ( c = xt_find_node( node->children, "si" ) ) && 130 ( s = xt_find_attr( c, "xmlns" ) ) && 131 ( strcmp( s, XMLNS_SI ) == 0 ) ) 132 { 133 return jabber_si_handle_request( ic, node, c ); 134 } 135 else if( !( c = xt_find_node( node->children, "query" ) ) || 136 !( s = xt_find_attr( c, "xmlns" ) ) ) 126 if( !( c = xt_find_node( node->children, "query" ) ) || 127 !( s = xt_find_attr( c, "xmlns" ) ) ) 137 128 { 138 129 return XT_HANDLED; 139 130 } 140 else if( strcmp( s, XMLNS_ROSTER ) == 0 ) 141 { 131 142 132 /* This is a roster push. XMPP servers send this when someone 143 133 was added to (or removed from) the buddy list. AFAIK they're 144 134 sent even if we added this buddy in our own session. */ 135 if( strcmp( s, XMLNS_ROSTER ) == 0 ) 136 { 145 137 int bare_len = strlen( ic->acc->user ); 146 138 … … 159 151 160 152 xt_free_node( reply ); 161 reply = jabber_make_error_packet( node, "not-allowed", "cancel" , NULL);153 reply = jabber_make_error_packet( node, "not-allowed", "cancel" ); 162 154 pack = 0; 163 155 } 164 156 } 165 else if( strcmp( s, XMLNS_BYTESTREAMS ) == 0 )166 {167 /* Bytestream Request (stage 2 of file transfer) */168 return jabber_bs_recv_request( ic, node, c );169 }170 157 else 171 158 { 172 159 xt_free_node( reply ); 173 reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" , NULL);160 reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" ); 174 161 pack = 0; 175 162 } … … 621 608 return st; 622 609 } 623 624 xt_status jabber_iq_parse_features( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );625 626 xt_status jabber_iq_query_features( struct im_connection *ic, char *bare_jid )627 {628 struct xt_node *node, *query;629 struct jabber_buddy *bud;630 631 if( ( bud = jabber_buddy_by_jid( ic, bare_jid , 0 ) ) == NULL )632 {633 /* Who cares about the unknown... */634 imcb_log( ic, "Couldn't find buddy: %s", bare_jid);635 return XT_HANDLED;636 }637 638 if( bud->features ) /* been here already */639 return XT_HANDLED;640 641 node = xt_new_node( "query", NULL, NULL );642 xt_add_attr( node, "xmlns", XMLNS_DISCO_INFO );643 644 if( !( query = jabber_make_packet( "iq", "get", bare_jid, node ) ) )645 {646 imcb_log( ic, "WARNING: Couldn't generate feature query" );647 xt_free_node( node );648 return XT_HANDLED;649 }650 651 jabber_cache_add( ic, query, jabber_iq_parse_features );652 653 return jabber_write_packet( ic, query ) ? XT_HANDLED : XT_ABORT;654 }655 656 xt_status jabber_iq_parse_features( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )657 {658 struct xt_node *c;659 struct jabber_buddy *bud;660 char *feature, *xmlns, *from;661 662 if( !( from = xt_find_attr( node, "from" ) ) ||663 !( c = xt_find_node( node->children, "query" ) ) ||664 !( xmlns = xt_find_attr( c, "xmlns" ) ) ||665 !( strcmp( xmlns, XMLNS_DISCO_INFO ) == 0 ) )666 {667 imcb_log( ic, "WARNING: Received incomplete IQ-result packet for discover" );668 return XT_HANDLED;669 }670 if( ( bud = jabber_buddy_by_jid( ic, from, 0 ) ) == NULL )671 {672 /* Who cares about the unknown... */673 imcb_log( ic, "Couldn't find buddy: %s", from );674 return XT_HANDLED;675 }676 677 c = c->children;678 while( ( c = xt_find_node( c, "feature" ) ) )679 {680 feature = xt_find_attr( c, "var" );681 if( feature )682 bud->features = g_slist_append( bud->features, g_strdup( feature ) );683 c = c->next;684 }685 686 return XT_HANDLED;687 }688 689 xt_status jabber_iq_parse_server_features( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );690 691 xt_status jabber_iq_query_server( struct im_connection *ic, char *jid, char *xmlns )692 {693 struct xt_node *node, *query;694 struct jabber_data *jd = ic->proto_data;695 696 node = xt_new_node( "query", NULL, NULL );697 xt_add_attr( node, "xmlns", xmlns );698 699 if( !( query = jabber_make_packet( "iq", "get", jid, node ) ) )700 {701 imcb_log( ic, "WARNING: Couldn't generate server query" );702 xt_free_node( node );703 }704 705 jd->have_streamhosts--;706 jabber_cache_add( ic, query, jabber_iq_parse_server_features );707 708 return jabber_write_packet( ic, query ) ? XT_HANDLED : XT_ABORT;709 }710 711 /*712 * Query the server for "items", query each "item" for identities, query each "item" that's a proxy for it's bytestream info713 */714 xt_status jabber_iq_parse_server_features( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )715 {716 struct xt_node *c;717 struct jabber_data *jd = ic->proto_data;718 char *xmlns, *from;719 720 if( !( c = xt_find_node( node->children, "query" ) ) ||721 !( from = xt_find_attr( node, "from" ) ) ||722 !( xmlns = xt_find_attr( c, "xmlns" ) ) )723 {724 imcb_log( ic, "WARNING: Received incomplete IQ-result packet for discover" );725 return XT_HANDLED;726 }727 728 jd->have_streamhosts++;729 730 if( strcmp( xmlns, XMLNS_DISCO_ITEMS ) == 0 )731 {732 char *itemjid;733 734 /* answer from server */735 736 c = c->children;737 while( ( c = xt_find_node( c, "item" ) ) )738 {739 itemjid = xt_find_attr( c, "jid" );740 741 if( itemjid )742 jabber_iq_query_server( ic, itemjid, XMLNS_DISCO_INFO );743 744 c = c->next;745 }746 }747 else if( strcmp( xmlns, XMLNS_DISCO_INFO ) == 0 )748 {749 char *category, *type;750 751 /* answer from potential proxy */752 753 c = c->children;754 while( ( c = xt_find_node( c, "identity" ) ) )755 {756 category = xt_find_attr( c, "category" );757 type = xt_find_attr( c, "type" );758 759 if( type && ( strcmp( type, "bytestreams" ) == 0 ) &&760 category && ( strcmp( category, "proxy" ) == 0 ) )761 jabber_iq_query_server( ic, from, XMLNS_BYTESTREAMS );762 763 c = c->next;764 }765 }766 else if( strcmp( xmlns, XMLNS_BYTESTREAMS ) == 0 )767 {768 char *host, *jid, *port_s;769 int port;770 771 /* answer from proxy */772 773 if( ( c = xt_find_node( c->children, "streamhost" ) ) &&774 ( host = xt_find_attr( c, "host" ) ) &&775 ( port_s = xt_find_attr( c, "port" ) ) &&776 ( sscanf( port_s, "%d", &port ) == 1 ) &&777 ( jid = xt_find_attr( c, "jid" ) ) )778 {779 jabber_streamhost_t *sh = g_new0( jabber_streamhost_t, 1 );780 781 sh->jid = g_strdup( jid );782 sh->host = g_strdup( host );783 g_snprintf( sh->port, sizeof( sh->port ), "%u", port );784 785 imcb_log( ic, "Proxy found: jid %s host %s port %u", jid, host, port );786 jd->streamhosts = g_slist_append( jd->streamhosts, sh );787 }788 }789 790 if( jd->have_streamhosts == 0 )791 jd->have_streamhosts++;792 793 return XT_HANDLED;794 } -
protocols/jabber/jabber.c
r1fdb0a4 r3dc6d86 65 65 66 66 s = set_add( &acc->set, "priority", "0", set_eval_priority, acc ); 67 68 s = set_add( &acc->set, "proxy", "<local>;<auto>", NULL, acc );69 67 70 68 s = set_add( &acc->set, "resource", "BitlBee", NULL, acc ); … … 266 264 struct jabber_data *jd = ic->proto_data; 267 265 268 while( jd->filetransfers )269 imcb_file_canceled( ( ( struct jabber_transfer *) jd->filetransfers->data )->ft, "Logging out" );270 271 while( jd->streamhosts )272 {273 jabber_streamhost_t *sh = jd->streamhosts->data;274 jd->streamhosts = g_slist_remove( jd->streamhosts, sh );275 g_free( sh->jid );276 g_free( sh->host );277 g_free( sh );278 }279 280 266 if( jd->fd >= 0 ) 281 267 jabber_end_stream( ic ); … … 558 544 ret->send_typing = jabber_send_typing; 559 545 ret->handle_cmp = g_strcasecmp; 560 ret->transfer_request = jabber_si_transfer_request;561 546 562 547 register_protocol( ret ); -
protocols/jabber/jabber.h
r1fdb0a4 r3dc6d86 61 61 } jabber_buddy_flags_t; 62 62 63 /* Stores a streamhost's (a.k.a. proxy) data */64 typedef struct65 {66 char *jid;67 char *host;68 char port[6];69 } jabber_streamhost_t;70 71 63 typedef enum 72 64 { … … 99 91 GHashTable *node_cache; 100 92 GHashTable *buddies; 101 102 GSList *filetransfers;103 GSList *streamhosts;104 int have_streamhosts;105 93 }; 106 94 … … 139 127 struct jabber_away_state *away_state; 140 128 char *away_message; 141 GSList *features;142 129 143 130 time_t last_msg; … … 153 140 char *my_full_jid; /* Separate copy because of case sensitivity. */ 154 141 struct jabber_buddy *me; 155 };156 157 struct jabber_transfer158 {159 /* bitlbee's handle for this transfer */160 file_transfer_t *ft;161 162 /* the stream's private handle */163 gpointer streamhandle;164 165 /* timeout for discover queries */166 gint disco_timeout;167 gint disco_timeout_fired;168 169 struct im_connection *ic;170 171 struct jabber_buddy *bud;172 173 int watch_in;174 int watch_out;175 176 char *ini_jid;177 char *tgt_jid;178 char *iq_id;179 char *sid;180 int accepted;181 182 size_t bytesread, byteswritten;183 int fd;184 struct sockaddr_storage saddr;185 142 }; 186 143 … … 210 167 211 168 /* Some supported extensions/legacy stuff */ 212 #define XMLNS_AUTH "jabber:iq:auth" /* XEP-0078 */ 213 #define XMLNS_VERSION "jabber:iq:version" /* XEP-0092 */ 214 #define XMLNS_TIME "jabber:iq:time" /* XEP-0090 */ 215 #define XMLNS_PING "urn:xmpp:ping" /* XEP-0199 */ 216 #define XMLNS_VCARD "vcard-temp" /* XEP-0054 */ 217 #define XMLNS_DELAY "jabber:x:delay" /* XEP-0091 */ 218 #define XMLNS_XDATA "jabber:x:data" /* XEP-0004 */ 219 #define XMLNS_CHATSTATES "http://jabber.org/protocol/chatstates" /* XEP-0085 */ 220 #define XMLNS_DISCO_INFO "http://jabber.org/protocol/disco#info" /* XEP-0030 */ 221 #define XMLNS_DISCO_ITEMS "http://jabber.org/protocol/disco#items" /* XEP-0030 */ 222 #define XMLNS_MUC "http://jabber.org/protocol/muc" /* XEP-0045 */ 223 #define XMLNS_MUC_USER "http://jabber.org/protocol/muc#user" /* XEP-0045 */ 224 #define XMLNS_CAPS "http://jabber.org/protocol/caps" /* XEP-0115 */ 225 #define XMLNS_FEATURE "http://jabber.org/protocol/feature-neg" /* XEP-0020 */ 226 #define XMLNS_SI "http://jabber.org/protocol/si" /* XEP-0095 */ 227 #define XMLNS_FILETRANSFER "http://jabber.org/protocol/si/profile/file-transfer" /* XEP-0096 */ 228 #define XMLNS_BYTESTREAMS "http://jabber.org/protocol/bytestreams" /* XEP-0065 */ 229 #define XMLNS_IBB "http://jabber.org/protocol/ibb" /* XEP-0047 */ 169 #define XMLNS_AUTH "jabber:iq:auth" /* XEP-0078 */ 170 #define XMLNS_VERSION "jabber:iq:version" /* XEP-0092 */ 171 #define XMLNS_TIME "jabber:iq:time" /* XEP-0090 */ 172 #define XMLNS_PING "urn:xmpp:ping" /* XEP-0199 */ 173 #define XMLNS_VCARD "vcard-temp" /* XEP-0054 */ 174 #define XMLNS_DELAY "jabber:x:delay" /* XEP-0091 */ 175 #define XMLNS_CHATSTATES "http://jabber.org/protocol/chatstates" /* 0085 */ 176 #define XMLNS_DISCOVER "http://jabber.org/protocol/disco#info" /* 0030 */ 177 #define XMLNS_MUC "http://jabber.org/protocol/muc" /* XEP-0045 */ 178 #define XMLNS_MUC_USER "http://jabber.org/protocol/muc#user"/* XEP-0045 */ 179 #define XMLNS_CAPS "http://jabber.org/protocol/caps" /* XEP-0115 */ 230 180 231 181 /* iq.c */ … … 237 187 int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name ); 238 188 int jabber_remove_from_roster( struct im_connection *ic, char *handle ); 239 xt_status jabber_iq_query_features( struct im_connection *ic, char *bare_jid );240 xt_status jabber_iq_query_server( struct im_connection *ic, char *jid, char *xmlns );241 242 /* si.c */243 int jabber_si_handle_request( struct im_connection *ic, struct xt_node *node, struct xt_node *sinode );244 void jabber_si_transfer_request( struct im_connection *ic, file_transfer_t *ft, char *who );245 void jabber_si_free_transfer( file_transfer_t *ft);246 247 /* s5bytestream.c */248 int jabber_bs_recv_request( struct im_connection *ic, struct xt_node *node, struct xt_node *qnode);249 gboolean jabber_bs_send_start( struct jabber_transfer *tf );250 gboolean jabber_bs_send_write( file_transfer_t *ft, char *buffer, unsigned int len );251 189 252 190 /* message.c */ … … 262 200 char *set_eval_tls( set_t *set, char *value ); 263 201 struct xt_node *jabber_make_packet( char *name, char *type, char *to, struct xt_node *children ); 264 struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type , char *err_code);202 struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type ); 265 203 void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func ); 266 204 struct xt_node *jabber_cache_get( struct im_connection *ic, char *id ); -
protocols/jabber/jabber_util.c
r1fdb0a4 r3dc6d86 99 99 } 100 100 101 struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type , char *err_code)101 struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type ) 102 102 { 103 103 struct xt_node *node, *c; … … 111 111 c = xt_new_node( "error", NULL, c ); 112 112 xt_add_attr( c, "type", err_type ); 113 114 /* Add the error code, if present */115 if (err_code)116 xt_add_attr( c, "code", err_code );117 113 118 114 /* To make the actual error packet, we copy the original packet and -
protocols/msn/Makefile
r1fdb0a4 r3dc6d86 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR11 SRCDIR := $(SRCDIR)protocols/msn/12 endif13 10 14 11 # [SH] Program variables 15 objects = invitation.omsn.o msn_util.o ns.o passport.o sb.o tables.o12 objects = msn.o msn_util.o ns.o passport.o sb.o tables.o 16 13 17 14 CFLAGS += -Wall … … 36 33 $(objects): ../../Makefile.settings Makefile 37 34 38 $(objects): %.o: $(SRCDIR)%.c35 $(objects): %.o: %.c 39 36 @echo '*' Compiling $< 40 37 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/msn/msn.c
r1fdb0a4 r3dc6d86 79 79 if( md ) 80 80 { 81 while( md->filetransfers ) {82 imcb_file_canceled( md->filetransfers->data, "Closing connection" );83 }84 85 81 if( md->fd >= 0 ) 86 82 closesocket( md->fd ); … … 332 328 ret->send_typing = msn_send_typing; 333 329 ret->handle_cmp = g_strcasecmp; 334 ret->transfer_request = msn_ftp_transfer_request;335 330 336 331 register_protocol(ret); -
protocols/msn/msn.h
r1fdb0a4 r3dc6d86 74 74 int sb_failures; 75 75 time_t first_sb_failure; 76 GSList *filetransfers;77 76 78 77 const struct msn_away_state *away_state; … … 190 189 void msn_sb_stop_keepalives( struct msn_switchboard *sb ); 191 190 192 /* invitation.c */193 void msn_ftp_transfer_request( struct im_connection *ic, file_transfer_t *ft, char *who );194 195 191 #endif //_MSN_H -
protocols/msn/ns.c
r1fdb0a4 r3dc6d86 76 76 if( msn_write( ic, s, strlen( s ) ) ) 77 77 { 78 ic->inpa = b_input_add( md->fd, B_EV_IO_READ, msn_ns_callback, ic );78 ic->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, ic ); 79 79 imcb_log( ic, "Connected to server, waiting for reply" ); 80 80 } -
protocols/msn/sb.c
r1fdb0a4 r3dc6d86 29 29 #include "passport.h" 30 30 #include "md5.h" 31 #include "invitation.h"32 31 33 32 static gboolean msn_sb_callback( gpointer data, gint source, b_input_condition cond ); … … 174 173 buf = g_new0( char, i ); 175 174 i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->ic->acc->user ); 176 }177 else if( strncmp( text, MSN_INVITE_HEADERS, sizeof( MSN_INVITE_HEADERS ) - 1 ) == 0 )178 {179 buf = g_strdup( text );180 i = strlen( buf );181 175 } 182 176 else if( strcmp( text, SB_KEEPALIVE_MESSAGE ) == 0 ) … … 321 315 322 316 if( msn_sb_write( sb, buf, strlen( buf ) ) ) 323 sb->inp = b_input_add( sb->fd, B_EV_IO_READ, msn_sb_callback, sb );317 sb->inp = b_input_add( sb->fd, GAIM_INPUT_READ, msn_sb_callback, sb ); 324 318 else 325 319 debug( "Error %d while connecting to switchboard server", 2 ); … … 700 694 else if( g_strncasecmp( ct, "text/x-msmsgsinvite", 19 ) == 0 ) 701 695 { 702 char *command = msn_findheader( body, "Invitation-Command:", blen ); 703 char *cookie = msn_findheader( body, "Invitation-Cookie:", blen ); 704 unsigned int icookie; 696 char *itype = msn_findheader( body, "Application-GUID:", blen ); 697 char buf[1024]; 705 698 706 699 g_free( ct ); 707 700 708 /* Every invite should have both a Command and Cookie header */ 709 if( !command || !cookie ) { 710 g_free( command ); 711 g_free( cookie ); 712 imcb_log( ic, "Warning: No command or cookie from %s", sb->who ); 713 return 1; 714 } 715 716 icookie = strtoul( cookie, NULL, 10 ); 717 g_free( cookie ); 718 719 if( g_strncasecmp( command, "INVITE", 6 ) == 0 ) { 720 msn_invitation_invite( sb, cmd[1], icookie, body, blen ); 721 } else if( g_strncasecmp( command, "ACCEPT", 6 ) == 0 ) { 722 msn_invitation_accept( sb, cmd[1], icookie, body, blen ); 723 } else if( g_strncasecmp( command, "CANCEL", 6 ) == 0 ) { 724 msn_invitation_cancel( sb, cmd[1], icookie, body, blen ); 725 } else { 726 imcb_log( ic, "Warning: Received invalid invitation with " 727 "command %s from %s", command, sb->who ); 728 } 729 730 g_free( command ); 731 } 732 else if( g_strncasecmp( ct, "application/x-msnmsgrp2p", 24 ) == 0 ) 733 { 734 imcb_error( sb->ic, "Cannot receive file from %s: BitlBee does not " 735 "support msnmsgrp2p yet.", sb->who ); 736 g_free( ct ); 701 *buf = 0; 702 703 if( !itype ) 704 return( 1 ); 705 706 /* File transfer. */ 707 if( strcmp( itype, "{5D3E02AB-6190-11d3-BBBB-00C04F795683}" ) == 0 ) 708 { 709 char *name = msn_findheader( body, "Application-File:", blen ); 710 char *size = msn_findheader( body, "Application-FileSize:", blen ); 711 712 if( name && size ) 713 { 714 g_snprintf( buf, sizeof( buf ), "<< \x02""BitlBee\x02"" - Filetransfer: `%s', %s bytes >>\n" 715 "Filetransfers are not supported by BitlBee for now...", name, size ); 716 } 717 else 718 { 719 strcpy( buf, "<< \x02""BitlBee\x02"" - Corrupted MSN filetransfer invitation message >>" ); 720 } 721 722 if( name ) g_free( name ); 723 if( size ) g_free( size ); 724 } 725 else 726 { 727 char *iname = msn_findheader( body, "Application-Name:", blen ); 728 729 g_snprintf( buf, sizeof( buf ), "<< \x02""BitlBee\x02"" - Unknown MSN invitation - %s (%s) >>", 730 itype, iname ? iname : "no name" ); 731 732 if( iname ) g_free( iname ); 733 } 734 735 g_free( itype ); 736 737 if( !*buf ) 738 return( 1 ); 739 740 if( sb->who ) 741 { 742 imcb_buddy_msg( ic, cmd[1], buf, 0, 0 ); 743 } 744 else if( sb->chat ) 745 { 746 imcb_chat_msg( sb->chat, cmd[1], buf, 0, 0 ); 747 } 748 else 749 { 750 /* PANIC! */ 751 } 737 752 } 738 753 else if( g_strncasecmp( ct, "text/x-msmsgscontrol", 20 ) == 0 ) -
protocols/nogaim.c
r1fdb0a4 r3dc6d86 117 117 { 118 118 GList *gl; 119 120 for( gl = protocols; gl; gl = gl->next ) 119 for (gl = protocols; gl; gl = gl->next) 121 120 { 122 121 struct prpl *proto = gl->data; 123 124 if( g_strcasecmp( proto->name, name ) == 0 ) 122 if(!g_strcasecmp(proto->name, name)) 125 123 return proto; 126 124 } 127 128 125 return NULL; 129 126 } … … 137 134 extern void jabber_initmodule(); 138 135 extern void twitter_initmodule(); 139 extern void purple_initmodule();140 136 141 137 #ifdef WITH_MSN … … 157 153 #ifdef WITH_TWITTER 158 154 twitter_initmodule(); 159 #endif160 161 #ifdef WITH_PURPLE162 purple_initmodule();163 155 #endif 164 156 -
protocols/nogaim.h
r1fdb0a4 r3dc6d86 45 45 #include "proxy.h" 46 46 #include "query.h" 47 #include "md5.h"48 #include "ft.h"49 47 50 48 #define BUDDY_ALIAS_MAXLEN 388 /* because MSN names can be 387 characters */ … … 134 132 * - The user sees this name ie. when imcb_log() is used. */ 135 133 const char *name; 136 void *data;137 134 138 135 /* Added this one to be able to add per-account settings, don't think … … 231 228 void (* auth_allow) (struct im_connection *, const char *who); 232 229 void (* auth_deny) (struct im_connection *, const char *who); 233 234 /* Incoming transfer request */235 void (* transfer_request) (struct im_connection *, file_transfer_t *ft, char *handle );236 230 }; 237 231 -
protocols/oscar/Makefile
r1fdb0a4 r3dc6d86 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR11 SRCDIR := $(SRCDIR)protocols/oscar/12 CFLAGS += -I$(SRCDIR)13 endif14 10 15 11 # [SH] Program variables … … 37 33 $(objects): ../../Makefile.settings Makefile 38 34 39 $(objects): %.o: $(SRCDIR)%.c35 $(objects): %.o: %.c 40 36 @echo '*' Compiling $< 41 37 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/oscar/oscar.c
r1fdb0a4 r3dc6d86 290 290 odata = (struct oscar_data *)ic->proto_data; 291 291 292 if (condition & B_EV_IO_READ) {292 if (condition & GAIM_INPUT_READ) { 293 293 if (aim_get_command(odata->sess, conn) >= 0) { 294 294 aim_rxdispatch(odata->sess); … … 362 362 363 363 aim_conn_completeconnect(sess, conn); 364 ic->inpa = b_input_add(conn->fd, B_EV_IO_READ,364 ic->inpa = b_input_add(conn->fd, GAIM_INPUT_READ, 365 365 oscar_callback, conn); 366 366 … … 493 493 494 494 aim_conn_completeconnect(sess, bosconn); 495 ic->inpa = b_input_add(bosconn->fd, B_EV_IO_READ,495 ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ, 496 496 oscar_callback, bosconn); 497 497 imcb_log(ic, _("Connection established, cookie sent")); … … 703 703 704 704 aim_conn_completeconnect(sess, tstconn); 705 odata->cnpa = b_input_add(tstconn->fd, B_EV_IO_READ,705 odata->cnpa = b_input_add(tstconn->fd, GAIM_INPUT_READ, 706 706 oscar_callback, tstconn); 707 707 … … 731 731 732 732 aim_conn_completeconnect(sess, tstconn); 733 odata->paspa = b_input_add(tstconn->fd, B_EV_IO_READ,733 odata->paspa = b_input_add(tstconn->fd, GAIM_INPUT_READ, 734 734 oscar_callback, tstconn); 735 735 … … 767 767 aim_conn_completeconnect(sess, ccon->conn); 768 768 ccon->inpa = b_input_add(tstconn->fd, 769 B_EV_IO_READ,769 GAIM_INPUT_READ, 770 770 oscar_callback, tstconn); 771 771 odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon); -
protocols/twitter/Makefile
r1fdb0a4 r3dc6d86 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR11 SRCDIR := $(SRCDIR)protocols/twitter/12 endif13 10 14 11 # [SH] Program variables … … 36 33 $(objects): ../../Makefile.settings Makefile 37 34 38 $(objects): %.o: $(SRCDIR)%.c35 $(objects): %.o: %.c 39 36 @echo '*' Compiling $< 40 37 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/yahoo/Makefile
r1fdb0a4 r3dc6d86 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR11 SRCDIR := $(SRCDIR)protocols/yahoo/12 endif13 10 14 11 # [SH] Program variables … … 36 33 $(objects): ../../Makefile.settings Makefile 37 34 38 $(objects): %.o: $(SRCDIR)%.c35 $(objects): %.o: %.c 39 36 @echo '*' Compiling $< 40 37 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/yahoo/yahoo.c
r1fdb0a4 r3dc6d86 686 686 687 687 inp->d = d; 688 d->tag = inp->h = b_input_add( fd, B_EV_IO_READ, (b_event_handler) byahoo_read_ready_callback, (gpointer) d );688 d->tag = inp->h = b_input_add( fd, GAIM_INPUT_READ, (b_event_handler) byahoo_read_ready_callback, (gpointer) d ); 689 689 } 690 690 else if( cond == YAHOO_INPUT_WRITE ) … … 697 697 698 698 inp->d = d; 699 d->tag = inp->h = b_input_add( fd, B_EV_IO_WRITE, (b_event_handler) byahoo_write_ready_callback, (gpointer) d );699 d->tag = inp->h = b_input_add( fd, GAIM_INPUT_WRITE, (b_event_handler) byahoo_write_ready_callback, (gpointer) d ); 700 700 } 701 701 else -
root_commands.c
r1fdb0a4 r3dc6d86 26 26 #define BITLBEE_CORE 27 27 #include "commands.h" 28 #include "crypting.h" 28 29 #include "bitlbee.h" 29 30 #include "help.h" … … 1153 1154 { 1154 1155 irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] ); 1155 }1156 }1157 1158 static void cmd_transfer( irc_t *irc, char **cmd )1159 {1160 GSList *files = irc->file_transfers;1161 enum { LIST, REJECT, CANCEL };1162 int subcmd = LIST;1163 int fid;1164 1165 if( !files )1166 {1167 irc_usermsg( irc, "No pending transfers" );1168 return;1169 }1170 1171 if( cmd[1] && ( strcmp( cmd[1], "reject" ) == 0 ) )1172 {1173 subcmd = REJECT;1174 }1175 else if( cmd[1] && ( strcmp( cmd[1], "cancel" ) == 0 ) &&1176 cmd[2] && ( sscanf( cmd[2], "%d", &fid ) == 1 ) )1177 {1178 subcmd = CANCEL;1179 }1180 1181 for( ; files; files = g_slist_next( files ) )1182 {1183 file_transfer_t *file = files->data;1184 1185 switch( subcmd ) {1186 case LIST:1187 if ( file->status == FT_STATUS_LISTENING )1188 irc_usermsg( irc,1189 "Pending file(id %d): %s (Listening...)", file->local_id, file->file_name);1190 else1191 {1192 int kb_per_s = 0;1193 time_t diff = time( NULL ) - file->started ? : 1;1194 if ( ( file->started > 0 ) && ( file->bytes_transferred > 0 ) )1195 kb_per_s = file->bytes_transferred / 1024 / diff;1196 1197 irc_usermsg( irc,1198 "Pending file(id %d): %s (%10zd/%zd kb, %d kb/s)", file->local_id, file->file_name,1199 file->bytes_transferred/1024, file->file_size/1024, kb_per_s);1200 }1201 break;1202 case REJECT:1203 if( file->status == FT_STATUS_LISTENING )1204 {1205 irc_usermsg( irc, "Rejecting file transfer for %s", file->file_name );1206 imcb_file_canceled( file, "Denied by user" );1207 }1208 break;1209 case CANCEL:1210 if( file->local_id == fid )1211 {1212 irc_usermsg( irc, "Canceling file transfer for %s", file->file_name );1213 imcb_file_canceled( file, "Canceled by user" );1214 }1215 break;1216 }1217 1156 } 1218 1157 } … … 1239 1178 { "join_chat", 2, cmd_join_chat, 0 }, 1240 1179 { "chat", 1, cmd_chat, 0 }, 1241 { "transfer", 0, cmd_transfer, 0 },1242 1180 { NULL } 1243 1181 }; -
set.c
r1fdb0a4 r3dc6d86 29 29 char *SET_INVALID = "nee"; 30 30 31 set_t *set_add( set_t **head, c onst char *key, constchar *def, set_eval eval, void *data )31 set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data ) 32 32 { 33 33 set_t *s = set_find( head, key ); … … 63 63 } 64 64 65 set_t *set_find( set_t **head, c onst char *key )65 set_t *set_find( set_t **head, char *key ) 66 66 { 67 67 set_t *s = *head; … … 77 77 } 78 78 79 char *set_getstr( set_t **head, c onst char *key )79 char *set_getstr( set_t **head, char *key ) 80 80 { 81 81 set_t *s = set_find( head, key ); … … 87 87 } 88 88 89 int set_getint( set_t **head, c onst char *key )89 int set_getint( set_t **head, char *key ) 90 90 { 91 91 char *s = set_getstr( head, key ); … … 101 101 } 102 102 103 int set_getbool( set_t **head, c onst char *key )103 int set_getbool( set_t **head, char *key ) 104 104 { 105 105 char *s = set_getstr( head, key ); … … 111 111 } 112 112 113 int set_setstr( set_t **head, c onst char *key, char *value )113 int set_setstr( set_t **head, char *key, char *value ) 114 114 { 115 115 set_t *s = set_find( head, key ); … … 150 150 } 151 151 152 int set_setint( set_t **head, c onst char *key, int value )152 int set_setint( set_t **head, char *key, int value ) 153 153 { 154 154 char s[24]; /* Not quite 128-bit clean eh? ;-) */ … … 158 158 } 159 159 160 void set_del( set_t **head, c onst char *key )160 void set_del( set_t **head, char *key ) 161 161 { 162 162 set_t *s = *head, *t = NULL; … … 182 182 } 183 183 184 int set_reset( set_t **head, c onst char *key )184 int set_reset( set_t **head, char *key ) 185 185 { 186 186 set_t *s; … … 211 211 { 212 212 return is_bool( value ) ? value : SET_INVALID; 213 }214 215 char *set_eval_list( set_t *set, char *value )216 {217 GSList *options = set->eval_data, *opt;218 219 for( opt = options; opt; opt = opt->next )220 if( strcmp( value, opt->data ) == 0 )221 return value;222 223 /* TODO: It'd be nice to show the user a list of allowed values,224 but we don't have enough context here to do that. May225 want to fix that. */226 227 return NULL;228 213 } 229 214 -
set.h
r1fdb0a4 r3dc6d86 69 69 set_setstr() should be able to free() the returned string! */ 70 70 set_eval eval; 71 void *eval_data;72 71 struct set *next; 73 72 } set_t; 74 73 75 74 /* Should be pretty clear. */ 76 set_t *set_add( set_t **head, c onst char *key, constchar *def, set_eval eval, void *data );75 set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data ); 77 76 78 77 /* Returns the raw set_t. Might be useful sometimes. */ 79 set_t *set_find( set_t **head, c onst char *key );78 set_t *set_find( set_t **head, char *key ); 80 79 81 80 /* Returns a pointer to the string value of this setting. Don't modify the 82 81 returned string, and don't free() it! */ 83 G_MODULE_EXPORT char *set_getstr( set_t **head, c onst char *key );82 G_MODULE_EXPORT char *set_getstr( set_t **head, char *key ); 84 83 85 84 /* Get an integer. In previous versions set_getint() was also used to read 86 85 boolean values, but this SHOULD be done with set_getbool() now! */ 87 G_MODULE_EXPORT int set_getint( set_t **head, c onst char *key );88 G_MODULE_EXPORT int set_getbool( set_t **head, c onst char *key );86 G_MODULE_EXPORT int set_getint( set_t **head, char *key ); 87 G_MODULE_EXPORT int set_getbool( set_t **head, char *key ); 89 88 90 89 /* set_setstr() strdup()s the given value, so after using this function 91 90 you can free() it, if you want. */ 92 int set_setstr( set_t **head, c onst char *key, char *value );93 int set_setint( set_t **head, c onst char *key, int value );94 void set_del( set_t **head, c onst char *key );95 int set_reset( set_t **head, c onst char *key );91 int set_setstr( set_t **head, char *key, char *value ); 92 int set_setint( set_t **head, char *key, int value ); 93 void set_del( set_t **head, char *key ); 94 int set_reset( set_t **head, char *key ); 96 95 97 96 /* Two very useful generic evaluators. */ 98 97 char *set_eval_int( set_t *set, char *value ); 99 98 char *set_eval_bool( set_t *set, char *value ); 100 101 /* Another more complicated one. */102 char *set_eval_list( set_t *set, char *value );103 99 104 100 /* Some not very generic evaluators that really shouldn't be here... */ -
storage.c
r1fdb0a4 r3dc6d86 28 28 #define BITLBEE_CORE 29 29 #include "bitlbee.h" 30 #include "crypting.h" 30 31 31 32 extern storage_t storage_text; … … 65 66 storage_t *storage; 66 67 68 register_storage_backend(&storage_text); 67 69 register_storage_backend(&storage_xml); 68 70 -
tests/Makefile
r1fdb0a4 r3dc6d86 1 1 -include ../Makefile.settings 2 ifdef SRCDIR3 SRCDIR := $(SRCDIR)tests/4 endif5 2 6 3 LFLAGS +=-lcheck … … 22 19 @$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS) 23 20 24 %.o: $(SRCDIR)%.c21 %.o: %.c 25 22 @echo '*' Compiling $< 26 23 @$(CC) -c $(CFLAGS) $< -o $@ -
unix.c
r1fdb0a4 r3dc6d86 56 56 57 57 log_init(); 58 59 58 global.conf_file = g_strdup( CONF_FILE_DEF ); 60 59 global.conf = conf_load( argc, argv ); … … 63 62 64 63 b_main_init(); 64 nogaim_init(); 65 65 66 66 srand( time( NULL ) ^ getpid() ); 67 68 67 global.helpfile = g_strdup( HELP_FILE ); 69 if( help_init( &global.help, global.helpfile ) == NULL )70 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );71 72 global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );73 if( global.storage == NULL )74 {75 log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage );76 return( 1 );77 }78 68 79 69 if( global.conf->runmode == RUNMODE_INETD ) … … 126 116 setuid( pw->pw_uid ); 127 117 } 118 } 119 120 global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage ); 121 if( global.storage == NULL ) 122 { 123 log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage ); 124 return( 1 ); 128 125 } 129 126 … … 145 142 if( !getuid() || !geteuid() ) 146 143 log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" ); 144 if( help_init( &global.help, global.helpfile ) == NULL ) 145 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE ); 147 146 148 147 b_main_run(); -
win32.c
r1fdb0a4 r3dc6d86 27 27 #include "bitlbee.h" 28 28 #include "commands.h" 29 #include "crypting.h" 29 30 #include "protocols/nogaim.h" 30 31 #include "help.h"
Note: See TracChangeset
for help on using the changeset viewer.