Changes in / [7a9d968:3f44e43]


Ignore:
Files:
17 added
5 deleted
67 edited

Legend:

Unmodified
Added
Removed
  • .travis.yml

    r7a9d968 r3f44e43  
    1 dist: precise
     1sudo: false
    22language: c
    33
     
    3131    - libpam0g-dev
    3232    - libldap2-dev
    33     - fakeroot
    34     - debhelper
    35     - devscripts
    3633  coverity_scan:
    3734    project:
  • Makefile

    r7a9d968 r3f44e43  
    9494        mkdir -p $(DESTDIR)$(SBINDIR)
    9595        $(INSTALL) -m 0755 $(OUTFILE) $(DESTDIR)$(SBINDIR)/$(OUTFILE)
    96 ifdef IMPLIB
    97         # import library for cygwin
    98         mkdir -p $(DESTDIR)$(LIBDIR)
    99         $(INSTALL) -m 0644 $(IMPLIB) $(DESTDIR)$(LIBDIR)/$(IMPLIB)
    100 endif
    10196
    10297uninstall-bin:
    10398        rm -f $(DESTDIR)$(SBINDIR)/$(OUTFILE)
    104 ifdef IMPLIB
    105         rm -f $(DESTDIR)$(LIBDIR)/$(IMPLIB)
    106 endif
    10799
    108100install-dev:
     
    171163
    172164$(subdirs):
    173         $(MAKE) -C $@ $(MAKECMDGOALS)
     165        @$(MAKE) -C $@ $(MAKECMDGOALS)
    174166
    175167$(OTR_PI): %.so: $(_SRCDIR_)%.c
    176168        @echo '*' Building plugin $@
    177         $(VERBOSE) $(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) $< -o $@ $(OTRFLAGS)
     169        @$(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) $< -o $@ $(OTRFLAGS)
    178170
    179171$(SKYPE_PI): $(_SRCDIR_)protocols/skype/skype.c
    180172        @echo '*' Building plugin skype
    181         $(VERBOSE) $(CC) $(CFLAGS) $(LDFLAGS) $(SKYPEFLAGS) $< -o $@
     173        @$(CC) $(CFLAGS) $(LDFLAGS) $(SKYPEFLAGS) $< -o $@
    182174
    183175$(objects): %.o: $(_SRCDIR_)%.c
    184176        @echo '*' Compiling $<
    185         $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
     177        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    186178
    187179$(objects): Makefile Makefile.settings config.h
     
    189181$(OUTFILE): $(objects) $(subdirs)
    190182        @echo '*' Linking $(OUTFILE)
    191         $(VERBOSE) $(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LDFLAGS_BITLBEE) $(LDFLAGS) $(EFLAGS)
    192 ifneq ($(firstword $(STRIP)), \#)
     183        @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LDFLAGS_BITLBEE) $(LDFLAGS) $(EFLAGS)
     184ifndef DEBUG
    193185        @echo '*' Stripping $(OUTFILE)
    194         $(VERBOSE) -$(STRIP) $(OUTFILE)
     186        @-$(STRIP) $(OUTFILE)
    195187endif
    196188
  • bitlbee.h

    r7a9d968 r3f44e43  
    3636
    3737#define PACKAGE "BitlBee"
    38 #define BITLBEE_VERSION "3.5.1"
     38#define BITLBEE_VERSION "3.4.2"
    3939#define VERSION BITLBEE_VERSION
    4040#define BITLBEE_VER(a, b, c) (((a) << 16) + ((b) << 8) + (c))
    41 #define BITLBEE_VERSION_CODE BITLBEE_VER(3, 5, 1)
     41#define BITLBEE_VERSION_CODE BITLBEE_VER(3, 4, 2)
    4242#define BITLBEE_ABI_VERSION_CODE 1
    4343
  • configure

    r7a9d968 r3f44e43  
    1515datadir='$prefix/share/bitlbee/'
    1616config='/var/lib/bitlbee/'
    17 libdir='$prefix/lib/'
    1817plugindir='$prefix/lib/bitlbee/'
    1918rpcplugindir='$plugindir/rpc/'
     
    4241rpc=1
    4342
    44 verbose=0
    4543doc=1
    4644debug=0
    47 strip=0
     45strip=1
    4846gcov=0
    4947asan=0
     
    131129--config=...                                            $config
    132130
    133 --verbose=0/1   Disable/enable verbose build            $verbose
    134 
    135131--msn=0/1       Disable/enable MSN part                 $msn
    136132--jabber=0/1    Disable/enable Jabber part              $jabber
     
    178174datadir=$(eval echo "$datadir/" | sed 's/\/\{1,\}/\//g')
    179175config=$(eval echo "$config/" | sed 's/\/\{1,\}/\//g')
    180 libdir=$(eval echo "$libdir/" | sed 's/\/\{1,\}/\//g')
    181176plugindir=$(eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g')
    182177rpcplugindir=$(eval echo "$rpcplugindir/" | sed 's/\/\{1,\}/\//g')
     
    204199RPCPLUGINDIR=$rpcplugindir
    205200CONFIG=$config
    206 LIBDIR=$libdir
    207201INCLUDEDIR=$includedir
    208202PCDIR=$pcdir
     
    254248#define PLUGINDIR "$plugindir"
    255249#define RPCPLUGINDIR "$rpcplugindir"
    256 #define DATADIR "$datadir"
    257250#define PIDFILE "$pidfile"
    258251#define IPCSOCKET "$ipcsocket"
     
    303296fi
    304297
    305 if [ "$verbose" = "0" ]; then
    306         echo 'VERBOSE=@' >> Makefile.settings
    307 else
    308         echo 'VERBOSE=' >> Makefile.settings
    309 fi
    310 
    311 cat <<EOF >>Makefile.settings
    312 
    313 # Enable/disable output verbosity
    314 ifdef V
    315 ifeq (\$(V),1)
    316         VERBOSE=
    317 else
    318         VERBOSE=@
    319 endif
    320 endif
    321 
    322 EOF
    323 
    324298if [ "$debug" = "1" ]; then
    325299        echo 'DEBUG=1' >> Makefile.settings
    326300        CFLAGS="$CFLAGS -g3 -DDEBUG -O0"
    327301else
    328         [ -z "$CFLAGS" ] && CFLAGS="-g -O2 -fno-strict-aliasing"
     302        [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing"
    329303fi
    330304
     
    790764if [ "$doc" = "1" ]; then
    791765        # check this here just in case someone tries to install it in python2.4...
    792         if [ ! -e $srcdir/doc/user-guide/help.txt ] && ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then
     766        if ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then
    793767                echo
    794768                echo 'ERROR: Python (>=2.5 or 3.x) is required to generate docs'
     
    823797fi
    824798
    825 pkgconfiglibs=''
    826 case "$arch" in
    827 CYGWIN* )
    828         pkgconfiglibs='-L${libdir} -lbitlbee -no-undefined'
    829 esac
    830 
    831799cat <<EOF >bitlbee.pc
    832800prefix=$prefix
     
    834802plugindir=$plugindir
    835803rpcplugindir=$rpcplugindir
    836 libdir=$libdir
    837 datadir=$datadir
    838804
    839805Name: bitlbee
     
    841807Requires: glib-2.0
    842808Version: $BITLBEE_VERSION
    843 Libs: $pkgconfiglibs
     809Libs:
    844810Cflags: -I\${includedir}
    845811
     
    959925;;
    960926CYGWIN* )
    961         echo 'EFLAGS+=-Wl,--export-all,--out-implib,libbitlbee.dll.a' >> Makefile.settings
    962         echo 'IMPLIB=libbitlbee.dll.a' >> Makefile.settings
    963927;;
    964928Windows )
  • dcc.c

    r7a9d968 r3f44e43  
    9292        struct sockaddr_storage saddr;
    9393        char *errmsg;
    94         char host[NI_MAXHOST];
     94        char host[HOST_NAME_MAX];
    9595        char port[6];
    9696
  • debian/README.Debian

    r7a9d968 r3f44e43  
    1 Fire up your favourite IRC client and connect to localhost:6667,
     1                   *** NEWS (Version 1.2 and later) ***
     2
     3Starting from version 1.2, BitlBee has a forking daemon mode. The Debian
     4package now uses this mode by default, instead of inetd mode. If you don't
     5want to use this, you can disable the init scripts (best way to do this is
     6by editing /etc/default/bitlbee) and restore the inetd.conf entry. This
     7should be necessary only once, it won't be touched during upgrades.
     8
     9Another important change in BitlBee 1.2 is the file format used for your
     10personal settings. Everything's now saved in a single .xml (per account,
     11of course) file instead of $nick.accounts and $nick.nicks. One advantage
     12of this new format is that the passwords are actually encrypted instead of
     13just vaguely obfuscated. BitlBee can still read the old files, and will
     14save things in the new format when you save/disconnect. After that, you
     15can safely remove the old-style files (this is recommended).
     16
     17I tried making this transition (the new file format but especially, in this
     18case, the inetd->forkdaemon mode change) as smooth as possible, but I'm
     19aware that many BitlBee users will have their own hacks already to run the
     20program. I hope the package won't break any of this for anyone. 1.2-2
     21should fix at least some of the issues.
     22
     23---------------------------------------------------------------------------
     24
     25Debconf should have asked you on what port you want BitlBee to run. If it
     26did not, the port number should be 6667 or 6668. (6668 if you already got
     27something running at 6667)
     28
     29Fire up your favourite IRC client and connect to localhost:6667 (or 6668),
    230and read the documentation (type help for a list of commands).
    331
  • debian/bitlbee-common.init

    r7a9d968 r3f44e43  
    2323[ -x $DAEMON ] || exit 0
    2424
     25# Default value
     26BITLBEE_PORT=6667
    2527BITLBEE_OPTS=-F
     28
     29# Read config file if it is present.
     30if [ -r /etc/default/$NAME ]; then
     31        . /etc/default/$NAME
     32fi
    2633
    2734
     
    3542       
    3643        start-stop-daemon --start --quiet --pidfile $PIDFILE \
    37                 --exec $DAEMON -- -P $PIDFILE $BITLBEE_OPTS
     44                --exec $DAEMON -- -p $BITLBEE_PORT -P $PIDFILE $BITLBEE_OPTS
    3845}
    3946
     
    4956case "$1" in
    5057  start)
     58        [ "$BITLBEE_DISABLED" = "1" ] && exit 0
     59
    5160        echo -n "Starting $DESC: $NAME"
    5261        d_start
  • debian/bitlbee-common.postinst

    r7a9d968 r3f44e43  
    33set -e
    44
     5. /usr/share/debconf/confmodule
     6
     7db_get bitlbee/serveport
     8PORT="$RET"
     9
    510CONFDIR=/var/lib/bitlbee/
    611
    7 if [ -e /etc/default/bitlbee ]; then
    8    cat <<EOF >/etc/default/bitlbee
     12## Load default option. Don't want to put this in debconf (yet?)
     13BITLBEE_OPTS=-F
     14BITLBEE_DISABLED=0
     15BITLBEE_UPGRADE_DONT_RESTART=0
     16[ -r /etc/default/bitlbee ] && . /etc/default/bitlbee
     17
     18if [ "$BITLBEE_DISABLED" = "0" ] && which update-inetd > /dev/null 2> /dev/null &&
     19   ( expr "$2" : '0\..*' > /dev/null || expr "$2" : '1\.0\..*' > /dev/null ); then
     20        ## Make sure the inetd entry is gone (can still be there from a
     21        ## previous version.
     22        update-inetd --remove '.*/usr/sbin/bitlbee'
     23        if grep -q /usr/sbin/bitlbee /etc/inetd.conf 2> /dev/null; then
     24                # Thanks for breaking update-inetd! (bugs.debian.org/311111)
     25                # I hope that it works at least with xinetd, because this
     26                # emergency hack doesn't:
     27                perl -pi -e 's:^[^#].*/usr/sbin/bitlbee$:## Now using daemon mode\: # $&:' /etc/inetd.conf
     28                killall -HUP inetd || true
     29        fi
     30fi
     31
     32cat<<EOF>/etc/default/bitlbee
    933## /etc/default/bitlbee: Auto-generated/updated script.
    1034##
    11 ## This file is deprecated and no longer used.
    12 ## Please edit /etc/bitlbee/bitlbee.conf instead
     35## If running in (fork)daemon mode, listen on this TCP port.
     36BITLBEE_PORT="$PORT"
     37
     38## Use single-process or forking daemon mode? Can't be changed from debconf,
     39## but maintainer scripts will save your changes here.
     40BITLBEE_OPTS="$BITLBEE_OPTS"
     41
     42## In case you want to stick with inetd mode (or if you just want to disable
     43## the init scripts for some other reason), you can disable the init script
     44## here. (Just set it to 1)
     45BITLBEE_DISABLED=$BITLBEE_DISABLED
     46
     47## As a server operator, you can use the RESTART command to restart only the
     48## master process while keeping all the child processes and their IPC
     49## connections. By enabling this, the maintainer scripts won't restart
     50## BitlBee during upgrades so you can restart the master process by hand.
     51BITLBEE_UPGRADE_DONT_RESTART=$BITLBEE_UPGRADE_DONT_RESTART
    1352EOF
    1453
    15 fi
     54## Bye-bye DebConf, we don't need you anymore.
     55db_stop
    1656
    1757## Restore the helpfile in case we weren't upgrading but just reconfiguring:
     
    2464fi
    2565
    26 if [ -n "$2" -a -x "/etc/init.d/bitlbee" ]; then
     66if [ "$BITLBEE_UPGRADE_DONT_RESTART" != "1" -a  -n "$2" -a -x "/etc/init.d/bitlbee" ]; then
    2767        invoke-rc.d bitlbee restart
    2868fi
     
    3171if [ -d $CONFDIR ] && chown -R bitlbee: $CONFDIR; then
    3272        echo 'BitlBee (probably) already installed, skipping user/configdir installation'
    33 else
    34         adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee
     73        exit 0
    3574fi
    3675
     76adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee
    3777chmod 700 /var/lib/bitlbee/
    3878
  • debian/bitlbee-common.postrm

    r7a9d968 r3f44e43  
    55if [ "$1" = "purge" ]; then
    66        rm -f /etc/default/bitlbee
    7         deluser --system bitlbee > /dev/null || true
     7        deluser --system bitlbee || true
    88        rm -rf /var/lib/bitlbee ## deluser doesn't seem to do this for homedirs in /var
    99fi
  • debian/changelog

    r7a9d968 r3f44e43  
    1 bitlbee (3.5-2) unstable; urgency=medium
    2 
    3   * TFW you find out the corrected fix diff posted on #821967 was still the
    4     broken one and you end up doing your third upload in a weekend. :-(
    5     Obviously build-* targets shouldn't call into binary-*, as that one
    6     starts requiring root. This broke builds on buildd's.
    7   * Now contains the same fix like 3.4.2-1.1, which as it turns out 3.5-1.1
    8     did not. (Closes: #853017)
    9 
    10  -- Wilmer van der Gaast <wilmer@gaast.net>  Sat, 28 Jan 2017 21:06:27 +0000
    11 
    12 bitlbee (3.5-1.1) unstable; urgency=medium
    13 
    14   [ dequis ]
    15   * Merge back changes from 3.4.2-1.1 (Closes: #852897)
    16 
    17  -- dequis <dx@dxzone.com.ar>  Thu, 26 Jan 2017 21:39:24 -0300
    18 
    19 bitlbee (3.5-1) unstable; urgency=medium
    20 
    21   [ Jochen Sprickerhof ]
    22   * Drop dependency on net-tools
    23 
    24   [ dequis ]
    25   * Use dh_systemd
    26   * Drop support for /etc/default/bitlbee
    27   * Drop debconf and its translations (only used to ask for the port)
    28   * Add preinst script for a smoother transition to systemd units
    29   * Ignore the stdout of deluser, fixes postrm error exit code
    30   * Remove some mentions of yahoo in control and copyright
    31   * Remove outdated stuff from README.debian
    32 
    33   [ Wilmer van der Gaast ]
    34   * New upstream release.
    35 
    36  -- Wilmer van der Gaast <wilmer@gaast.net>  Tue, 24 Jan 2017 22:21:33 +0000
    37 
    38 bitlbee (3.4.2-1.1) unstable; urgency=medium
    39 
    40   * Non-maintainer upload.
    41   * Adding build-{arch,indep} targets. (Closes: #821967)
    42   * Added python to build depends.
    43 
    44  -- Michael Lustfield <michael@lustfield.net>  Mon, 18 Jul 2016 01:02:17 -0700
    45 
    461bitlbee (3.4.2-1) unstable; urgency=medium
    472
  • debian/control

    r7a9d968 r3f44e43  
    55Uploaders: Jelmer Vernooij <jelmer@debian.org>
    66Standards-Version: 3.9.8
    7 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls28-dev | libgnutls-dev | gnutls-dev, po-debconf, libpurple-dev, libotr5-dev, debhelper (>= 6.0.7~), dh-systemd (>= 1.5) | debhelper (<< 9.20131227), python
     7Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls28-dev | libgnutls-dev | gnutls-dev, po-debconf, libpurple-dev, libotr5-dev, debhelper (>= 6.0.7~), dh-systemd (>= 1.5) | debhelper (<< 9.20131227)
    88Homepage: http://www.bitlbee.org/
    99Vcs-Git: https://github.com/bitlbee/bitlbee
     
    1717Description: IRC to other chat networks gateway (default version)
    1818 This program can be used as an IRC server which forwards everything you
    19  say to people on other chat networks: Jabber (which includes Google
    20  Talk), ICQ, AIM, MSN and Twitter.
     19 say to people on other chat networks: Jabber (which includes Google Talk
     20 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.
    2121
    2222Package: bitlbee-libpurple
     
    2727Description: IRC to other chat networks gateway (using libpurple)
    2828 This program can be used as an IRC server which forwards everything you
    29  say to people on other chat networks: Jabber (which includes Google
    30  Talk), ICQ, AIM, MSN and Twitter.
     29 say to people on other chat networks: Jabber (which includes Google Talk
     30 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.
    3131 .
    3232 This package contains a version of BitlBee that uses the libpurple instant
     
    3939Package: bitlbee-common
    4040Architecture: all
    41 Depends: ${misc:Depends}, adduser
     41Depends: ${misc:Depends}, net-tools, adduser
    4242Replaces: bitlbee
    4343Description: IRC to other chat networks gateway (common files/docs)
    4444 This program can be used as an IRC server which forwards everything you
    45  say to people on other chat networks: Jabber (which includes Google
    46  Talk), ICQ, AIM, MSN and Twitter.
     45 say to people on other chat networks: Jabber (which includes Google Talk
     46 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.
    4747 .
    4848 This package contains common files (mostly documentation) for bitlbee and
     
    5454Description: IRC to other chat networks gateway (dev files)
    5555 This program can be used as an IRC server which forwards everything you
    56  say to people on other chat networks: Jabber (which includes Google
    57  Talk), ICQ, AIM, MSN and Twitter.
     56 say to people on other chat networks: Jabber (which includes Google Talk
     57 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.
    5858 .
    5959 This package holds development stuff for compiling plug-ins.
     
    6464Description: IRC to other chat networks gateway (OTR plugin)
    6565 This program can be used as an IRC server which forwards everything you
    66  say to people on other chat networks: Jabber (which includes Google
    67  Talk), ICQ, AIM, MSN and Twitter.
     66 say to people on other chat networks: Jabber (which includes Google Talk
     67 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.
    6868 .
    6969 This package contains a plugin that adds support for Off-The-Record
     
    7676Description: IRC to other chat networks gateway (Skype plugin)
    7777 This program can be used as an IRC server which forwards everything you
    78  say to people on other chat networks: Jabber (which includes Google
    79  Talk), ICQ, AIM, MSN and Twitter.
     78 say to people on other chat networks: Jabber (which includes Google Talk
     79 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.
    8080 .
    8181 This package contains a plugin that adds support for the Skype IM network.
  • debian/copyright

    r7a9d968 r3f44e43  
    1111
    1212Bits of third party code, also (L)GPLed:
     13* protocols/yahoo/ is libyahoo2 <http://libyahoo2.sf.net/>.
    1314* Some parts (though there is very little left at this point) are borrowed
    1415  from Gaim (version 0.58), now known as Pidgin <http://www.pidgin.im/>.
     
    1718* lib/json.[ch] is from <https://github.com/udp/json-parser> and licensed
    1819  under the modified BSD license.
    19 * lib/canohost.[ch] is from OpenSSH and licenced under the BSD-3-clause
    20   licence.
    2120
    2221
  • debian/rules

    r7a9d968 r3f44e43  
    4141
    4242HAS_DH_SYSTEMD:=$(shell dpkg-query -W -f='$${Status}' dh-systemd 2>/dev/null | grep -c "ok installed")
    43 
    44 # No difference at the build stage so just call main build target.
    45 # (Well indep could be docs-only but we prebuild them plus it's really
    46 # not that much work.)
    47 build-arch build-indep: build
    4843
    4944build: build-stamp
     
    120115        dh_installdebconf
    121116ifeq ($(HAS_DH_SYSTEMD),1)
    122         dh_systemd_enable --no-enable bitlbee.socket
    123         dh_systemd_enable bitlbee.service
     117        dh_systemd_enable
    124118        dh_installinit --init-script=bitlbee
    125119        dh_systemd_start
  • doc/CHANGES

    r7a9d968 r3f44e43  
    33
    44https://github.com/bitlbee/bitlbee/commits/master
    5 
    6 Version 3.5.1:
    7 
    8 - purple:
    9   * Fix crash on file transfer requests from unknown contacts. This was the
    10     result of an incomplete fix in the previous release and may result in
    11     remote DoS. Read the full security advisory at:
    12     https://bugs.bitlbee.org/ticket/1282
    13 - After some investigation we decided to reclassify a crash fix from the
    14   previous release as a security issue. Read the full security advisory at:
    15   https://bugs.bitlbee.org/ticket/1281
    16 - Included help.txt in the release tarball, which was missing in the previous
    17   release and resulted in adding python as a build dependency. The release
    18   tarball of 3.5.1 does not require python.
    19 
    20 Finished 30 Jan 2017
    21 
    22 Version 3.5:
    23 
    24 - ui:
    25   * "chat list": shows a list of existing server-side chatrooms. With some
    26     protocols, this is often the only way to add new channels.
    27     See 'help chat list' for details. (jgeboski)
    28   * "plugins": lists the installed plugins and their versions (jgeboski)
    29   * Add 'nick_lowercase' and 'nick_underscores' settings.
    30   * "handle_unknown" can be set per-account, not just globally
    31 
    32 - jabber:
    33   * Add "always_use_nicks" channel setting, for non-anonymous MUCs (trac #415)
    34     See 'help set always_use_nicks' for possible side effects.
    35   * Properly handle rejected file transfers
    36   * Don't send parts in a chat if someone is still connected from other devices
    37   * hipchat: support personal oauth tokens (manually generated ones)
    38 
    39 - twitter:
    40   * Hide muted tweets / no-retweets, add mute/unmute commands (Flexo)
    41   * Show full version of extended tweets (with slightly more than 140 chars)
    42 
    43 - purple:
    44   * Support setting chat room topics (EionRobb)
    45   * Support for extra groupchat settings. Shows an error if any required
    46     ones are missing. Look for purple_ prefixed settings in "chan #... set"
    47   * SIPE: persistent chats can be joined now, thanks to the "chat list" command
    48     and the above ("purple_uri" channel setting)
    49   * Fix a file transfer crash bug (Mainly affected telegram)
    50   * Honor protocol flag to not require a password (used in hangouts, telegram)
    51   * Set the contacts' nicks to the %full_name for a few whitelisted protocols
    52     (hangouts, funyahoo, icq, line)
    53   * LINE: added a hack to save its auth token, to avoid re-auth every time
    54   * Show self-messages in groupchat backlogs (before join)
    55 
    56 - yahoo:
    57   * Removed because they killed their old protocol on a two month notice.
    58     Use EionRobb's funyahoo purple plugin, or better yet, don't use yahoo.
    59 
    60 - Stuff for enterprise deployments (all done by Sevas)
    61   * Locked down accounts, useful when pregenerating user config files. An
    62     account that is marked with the locked="true" attribute can't be removed
    63     and its username/password can't be changed.
    64   * Locked down settings. Same as above, but for individual account settings.
    65   * AllowAccountAdd setting in bitlbee.conf, to disable adding new accounts.
    66   * PAM and LDAP authentication backends (not compiled by default)
    67 
    68 - For packagers:
    69   * Enabled debug symbols in non-debug builds, disabled stripping by default.
    70     This is closer to the default behavior of autotools, and --debug=1 is mostly
    71     to set the DEBUG macro and disable optimization.
    72 
    73 - For plugin devs:
    74   * Plugins should now include an "init_plugin_info" function which will be used
    75     for ABI version checking in the future. It's optional for now, but will be
    76     enforced later. See the commit log of d28fe1c for details. (jgeboski)
    77 
    78 Finished 8 Jan 2017
    795
    806Version 3.4.2:
  • doc/README

    r7a9d968 r3f44e43  
    161161file COPYING for this license.
    162162
     163The Yahoo! library used by BitlBee is libyahoo2 <http://libyahoo2.sf.net/>,
     164also licensed under the GPL.
     165
    163166
    164167        BitlBee - An IRC to other chat networks gateway
  • doc/bitlbee.8

    r7a9d968 r3f44e43  
    3939networks and acts as a gateway. Users can connect to the server
    4040with any normal IRC client and see their 'buddy list' in
    41 &bitlbee.
     41&bitlbee. It currently supports Oscar (AIM and ICQ),
     42MSN, Jabber, Yahoo! and Twitter.
    4243
    4344\fBbitlbee\fP should be called by
  • doc/user-guide/Installation.xml

    r7a9d968 r3f44e43  
    3636settings and buddy information. <filename>/var/lib/bitlbee/</filename>
    3737is the default value.</para></listitem>
    38 <listitem><para>msn, jabber, oscar, twitter - By default, support for all
     38<listitem><para>msn, jabber, oscar, yahoo - By default, support for all
    3939these IM-protocols (OSCAR is the protocol used by both ICQ and AIM) will
    4040be compiled in. To make the binary a bit smaller, you can use these options
  • doc/user-guide/Makefile

    r7a9d968 r3f44e43  
    3535        xsltproc --xinclude --output $@ docbook.xsl $<
    3636
    37 help.txt: $(_SRCDIR_)help.xml $(_SRCDIR_)commands.xml $(_SRCDIR_)misc.xml $(_SRCDIR_)quickstart.xml $(_SRCDIR_)twitter.xml
     37help.txt: $(_SRCDIR_)help.xml $(_SRCDIR_)commands.xml $(_SRCDIR_)misc.xml $(_SRCDIR_)quickstart.xml
    3838        $(PYTHON) $(_SRCDIR_)genhelp.py $< $@
    3939
  • doc/user-guide/commands.xml

    r7a9d968 r3f44e43  
    2121                        <description>
    2222                                <para>
    23                                         Adds an account on the given server with the specified protocol, username and password to the account list. For a list of supported protocols, use the <emphasis>plugins</emphasis> command. For more information about adding an account, see <emphasis>help account add &lt;protocol&gt;</emphasis>.
     23                                        Adds an account on the given server with the specified protocol, username and password to the account list. Supported protocols right now are: Jabber, MSN, OSCAR (AIM/ICQ), Yahoo and Twitter. For more information about adding an account, see <emphasis>help account add &lt;protocol&gt;</emphasis>.
    2424                                </para>
    2525
     
    184184        <bitlbee-command name="channel">
    185185                <short-description>Channel list maintenance</short-description>
    186                 <syntax>channel [&lt;channel id&gt;] &lt;action&gt; [&lt;arguments&gt;]</syntax>
     186                <syntax>channel [&lt;account id&gt;] &lt;action&gt; [&lt;arguments&gt;]</syntax>
    187187
    188188                <description>
     
    277277                        <description>
    278278                                <para>
    279                                         List existing named chatrooms provided by an account. Chats from this list can be referenced from <emphasis>chat add</emphasis> by using the number in the index column after a "!" as a shortcut.
    280                                 </para>
    281 
    282                                 <para>
    283                                         The server parameter is optional and currently only used by jabber.
     279                                        List existing chatrooms provided by an account. BitlBee needs this to propogate an internal list of chats. The existing chat can then be added with <emphasis>chat add</emphasis>, using the number in the index column after a "!" as a shortcut.
    284280                                </para>
    285281                        </description>
     
    342338                <description>
    343339                        <para>
    344                                 Requests IM-network-specific information about the specified user. The amount of information you'll get differs per protocol. For some protocols it'll give you an URL which you can visit with a normal web browser to get the information.
     340                                Requests IM-network-specific information about the specified user. The amount of information you'll get differs per protocol. For some protocols (ATM Yahoo! and MSN) it'll give you an URL which you can visit with a normal web browser to get the information.
    345341                        </para>
    346342                </description>
     
    891887                <description>
    892888                        <para>
    893                                 With this setting enabled, you can use some commands in your Twitter channel/query. See <emphasis>help twitter</emphasis> for the list of extra commands available.
     889                                With this setting enabled, you can use some commands in your Twitter channel/query. The commands are simple and not documented in too much detail:
     890                        </para>
     891
     892                        <variablelist>
     893                                <varlistentry><term>undo #[&lt;id&gt;]</term><listitem><para>Delete your last Tweet (or one with the given ID)</para></listitem></varlistentry>
     894                                <varlistentry><term>rt &lt;screenname|#id&gt;</term><listitem><para>Retweet someone's last Tweet (or one with the given ID)</para></listitem></varlistentry>
     895                                <varlistentry><term>reply &lt;screenname|#id&gt;</term><listitem><para>Reply to a Tweet (with a reply-to reference)</para></listitem></varlistentry>
     896                                <varlistentry><term>rawreply &lt;screenname|#id&gt;</term><listitem><para>Reply to a Tweet (with no reply-to reference)</para></listitem></varlistentry>
     897                                <varlistentry><term>report &lt;screenname|#id&gt;</term><listitem><para>Report the given user (or the user who posted the tweet with the given ID) for sending spam. This will also block them.</para></listitem></varlistentry>
     898                                <varlistentry><term>follow &lt;screenname&gt;</term><listitem><para>Start following a person</para></listitem></varlistentry>
     899                                <varlistentry><term>unfollow &lt;screenname&gt;</term><listitem><para>Stop following a person</para></listitem></varlistentry>
     900                                <varlistentry><term>favourite &lt;screenname|#id&gt;</term><listitem><para>Favo<emphasis>u</emphasis>rite the given user's most recent tweet, or the given tweet ID.</para></listitem></varlistentry>
     901                                <varlistentry><term>post &lt;message&gt;</term><listitem><para>Post a tweet</para></listitem></varlistentry>
     902                                <varlistentry><term>url &lt;screenname|#id&gt;</term><listitem><para>Show URL for a tweet to open it in a browser (and see context)</para></listitem></varlistentry>
     903                        </variablelist>
     904
     905                        <para>
     906                                Anything that doesn't look like a command will be treated as a tweet. Watch out for typos, or to avoid this behaviour, you can set this setting to <emphasis>strict</emphasis>, which causes the <emphasis>post</emphasis> command to become mandatory for posting a tweet.
    894907                        </para>
    895908                </description>
     
    9911004        </bitlbee-setting>
    9921005
    993         <bitlbee-setting name="handle_unknown" type="string" scope="account,global">
     1006        <bitlbee-setting name="handle_unknown" type="string" scope="global">
    9941007                <default>add_channel</default>
    995                 <possible-values>add_private, add_channel, ignore</possible-values>
    996 
    997                 <description>
    998                         <para>
    999                                 By default, messages from people who aren't in your contact list are shown in a control channel (add_channel) instead of as a private message (add_private)
     1008                <possible-values>root, add, add_private, add_channel, ignore</possible-values>
     1009
     1010                <description>
     1011                        <para>
     1012                                By default, messages from people who aren't in your contact list are shown in a control channel instead of as a private message.
    10001013                        </para>
    10011014
    10021015                        <para>
    10031016                                If you prefer to ignore messages from people you don't know, you can set this one to "ignore". "add_private" and "add_channel" are like add, but you can use them to make messages from unknown buddies appear in the channel instead of a query window.
    1004                         </para>
    1005 
    1006                         <para>
    1007                                 This can be set to individual accounts, which is useful to only ignore accounts that are targeted by spammers, without missing messages from legitimate unknown contacts in others. Note that incoming add requests are visible regardless of this setting.
    10081017                        </para>
    10091018
     
    10281037        </bitlbee-setting>
    10291038
     1039        <bitlbee-setting name="lcnicks" type="boolean" scope="global">
     1040                <default>true</default>
     1041
     1042                <description>
     1043                        <para>
     1044                                Hereby you can change whether you want all lower case nick names or leave the case as it intended by your peer.
     1045                        </para>
     1046                </description>
     1047
     1048        </bitlbee-setting>
     1049
    10301050        <bitlbee-setting name="local_display_name" type="boolean" scope="account">
    10311051                <default>false</default>
     
    10441064                <description>
    10451065                        <para>
    1046                                 Some protocols can notify via IM about new e-mail. If you want these notifications, you can enable this setting.
     1066                                Some protocols (MSN, Yahoo!, GTalk) can notify via IM about new e-mail. Since most people use their Hotmail/Yahoo! addresses as a spam-box, this is disabled default. If you want these notifications, you can enable this setting.
    10471067                        </para>
    10481068                </description>
     
    11921212                        </para>
    11931213                </description>
    1194         </bitlbee-setting>
    1195 
    1196         <bitlbee-setting name="nick_lowercase" type="boolean" scope="global">
    1197                 <default>true</default>
    1198 
    1199                 <description>
    1200                         <para>
    1201                                 If enabled, all nicknames are turned into lower case.
    1202                         </para>
    1203 
    1204                         <para>
    1205                                 See also the <emphasis>nick_underscores</emphasis> setting. This setting was previously known as <emphasis>lcnicks</emphasis>.
    1206                         </para>
    1207                 </description>
    1208 
    1209         </bitlbee-setting>
    1210 
    1211         <bitlbee-setting name="nick_underscores" type="boolean" scope="global">
    1212                 <default>true</default>
    1213 
    1214                 <description>
    1215                         <para>
    1216                                 If enabled, spaces in nicknames are turned into underscores instead of being stripped.
    1217                         </para>
    1218 
    1219                         <para>
    1220                                 See also the <emphasis>nick_lowercase</emphasis> setting.
    1221                         </para>
    1222                 </description>
    1223 
    12241214        </bitlbee-setting>
    12251215
     
    18601850        <bitlbee-command name="plugins">
    18611851                <short-description>List all the external plugins and protocols</short-description>
    1862                 <syntax>plugins [info &lt;name&gt;]</syntax>
     1852                <syntax>plugins</syntax>
    18631853
    18641854                <description>
    18651855                        <para>
    18661856                                This gives you a list of all the external plugins and protocols.
    1867                         </para>
    1868 
    1869                         <para>
    1870                                 Use the <emphasis>info</emphasis> subcommand to get more details about a plugin.
    18711857                        </para>
    18721858                </description>
  • doc/user-guide/genhelp.py

    r7a9d968 r3f44e43  
    7373
    7474def process_file(filename, parent=None):
    75     try:
    76         tree = ET.parse(open(filename)).getroot()
    77     except:
    78         sys.stderr.write("\nException while processing %s\n" % filename)
    79         raise
     75    tree = ET.parse(open(filename)).getroot()
    8076    fix_tree(tree)
    8177    return parse_tag(tree, parent)
  • doc/user-guide/help.xml

    r7a9d968 r3f44e43  
    1818  <varlistentry><term>groupchats</term><listitem><para>How to work with groupchats on BitlBee</para></listitem></varlistentry>
    1919  <varlistentry><term>nick_changes</term><listitem><para>Changing your nickname without losing any settings</para></listitem></varlistentry>
    20   <varlistentry><term>identify_methods</term><listitem><para>A list of ways to (auto-)identify to your account</para></listitem></varlistentry>
     20  <varlistentry><term>smileys</term><listitem><para>A summary of some non-standard smileys you might find and fail to understand</para></listitem></varlistentry>
    2121</variablelist>
    2222
     
    4949  <varlistentry><term>groupchats</term><listitem><para>How to work with groupchats on BitlBee</para></listitem></varlistentry>
    5050  <varlistentry><term>nick_changes</term><listitem><para>Changing your nickname without losing any settings</para></listitem></varlistentry>
    51   <varlistentry><term>identify_methods</term><listitem><para>A list of ways to (auto-)identify to your account</para></listitem></varlistentry>
     51  <varlistentry><term>smileys</term><listitem><para>A summary of some non-standard smileys you might find and fail to understand</para></listitem></varlistentry>
    5252</variablelist>
    5353
     
    6060<xi:include href="quickstart.xml"/>
    6161<xi:include href="commands.xml"/>
    62 <xi:include href="twitter.xml"/>
    6362<xi:include href="misc.xml"/>
    6463
  • doc/user-guide/misc.xml

    r7a9d968 r3f44e43  
    7777
    7878<para>
    79 Some protocols (like Jabber) also support named groupchats. BitlBee supports these too. You can use the <emphasis>chat add</emphasis> command to join them. See <emphasis>help chat add</emphasis> for more information.
    80 </para>
    81 
    82 <para>
    83 If you don't know the name of a named groupchat, you can try the <emphasis>chat list</emphasis> command to get a list of chatrooms from a server. See <emphasis>help chat list</emphasis> for usage instructions.
    84 </para>
     79Some protocols (like Jabber) also support named groupchats. BitlBee now supports these too. You can use the <emphasis>chat add</emphasis> command to join them. See <emphasis>help chat add</emphasis> for more information.
     80</para>
     81
    8582</sect1>
    8683
     
    268265everything in the handle up to the first @.
    269266</para>
    270 
    271 </sect1>
    272 
    273 <sect1 id="identify_methods">
    274 <title>Identifying to your BitlBee account</title>
    275 
    276 <para>There are several methods to identify (log in) to your registered BitlBee account. All of these are equivalent:</para>
    277 
    278 <variablelist>
    279         <varlistentry>
    280                 <term>The 'identify' command</term>
    281                 <listitem><para>sent to &amp;bitlbee or root. See <emphasis>help identify</emphasis> for details.</para></listitem>
    282         </varlistentry>
    283         <varlistentry>
    284                 <term>/msg nickserv identify</term>
    285                 <listitem><para>Same as above, but sent to NickServ. Useful with some auto-identify scripts.</para></listitem>
    286         </varlistentry>
    287         <varlistentry>
    288                 <term>/nickserv or /ns</term>
    289                 <listitem><para>Same as above, but using the command aliases to NickServ.</para></listitem>
    290         </varlistentry>
    291         <varlistentry>
    292                 <term>Server password</term>
    293                 <listitem><para>A field in the server connection settings of your irc client.</para></listitem>
    294         </varlistentry>
    295         <varlistentry>
    296                 <term>SASL PLAIN</term>
    297                 <listitem><para>A newer method, good choice if your client supports it. (Note: "SASL" is <emphasis>not</emphasis> related to "SSL")</para></listitem>
    298         </varlistentry>
    299 </variablelist>
    300 
    301 <para>To configure your client to auto-identify, the last two methods are recommended. SASL if you have it, but server password is often the easiest.</para>
    302 
    303 <para>Note: If you changed bitlbee.conf to have <emphasis>AuthMode = Closed</emphasis>, server password will be used for that instead. If you have never heard of that setting before, you can ignore it and just use it.</para>
    304267
    305268</sect1>
     
    499462</sect1>
    500463
    501 <sect1 id="whatsnew030500">
    502 <title>New stuff in BitlBee 3.5</title>
    503 
    504 <simplelist>
    505         <member>New commands: <emphasis>chat list</emphasis> and <emphasis>plugins</emphasis>. New settings: <emphasis>nick_lowercase</emphasis>, <emphasis>nick_underscores</emphasis></member>
    506         <member><emphasis>twitter:</emphasis> Hide muted tweets / no-retweets, add mute/unmute commands. Show full version of extended tweets.</member>
    507         <member><emphasis>jabber:</emphasis> <emphasis>always_use_nicks</emphasis> channel setting. Don't send parts in a chat if someone is still connected from other devices. Personal oauth token login for hipchat.</member>
    508         <member><emphasis>purple:</emphasis> Setting /topic. Fixes for SIPE and LINE. Don't ask for password if not needed (hangouts, telegram). Set nicks to %full_name for a few protocols (hangouts, funyahoo, icq, line)</member>
    509 </simplelist>
    510 
    511 <para>
    512 See the full changelog for details!
    513 </para>
    514 
    515 </sect1>
    516 
    517464</chapter>
  • doc/user-guide/quickstart.xml

    r7a9d968 r3f44e43  
    33
    44<para>
    5 Welcome to BitlBee, your IRC gateway to other instant messaging protocols.
     5Welcome to BitlBee, your IRC gateway to ICQ, MSN, AOL, Jabber, Yahoo! and Twitter.
    66</para>
    77
     
    4343
    4444<para>
    45 Other built-in IM protocols include msn, oscar and twitter. OSCAR is the protocol used by ICQ and AOL. Some protocols may be available as plugins that you can install, such as facebook, steam, discord and omegle. And you can get even more protocols by using the libpurple variant of BitlBee.
    46 </para>
    47 
    48 <para>
    49 For a list of currently supported protocols, use the <emphasis>plugins</emphasis> command. For more information about the <emphasis>account add</emphasis> command, see <emphasis>help account add</emphasis>.
     45Other available IM protocols are msn, oscar, yahoo and twitter. OSCAR is the protocol used by ICQ and AOL. For more information about the <emphasis>account add</emphasis> command, see <emphasis>help account add</emphasis>.
    5046</para>
    5147
     
    140136
    141137<para>
    142 If you're still looking for something, please visit us in #bitlbee on the OFTC network (irc.oftc.net). Good luck and enjoy the Bee!
     138If you're still looking for something, please visit us in #bitlbee on the OFTC network (you can connect via irc.bitlbee.org), or mail us your problem/suggestion. Good luck and enjoy the Bee!
    143139</para>
    144140
  • doc/user-guide/user-guide.xml

    r7a9d968 r3f44e43  
    3737  <xi:include href="quickstart.xml"/>
    3838  <xi:include href="commands.xml"/>
    39   <xi:include href="twitter.xml"/>
    4039  <xi:include href="misc.xml"/>
    4140
  • init/bitlbee.service.in

    r7a9d968 r3f44e43  
    11[Unit]
    22Description=BitlBee IRC/IM gateway
     3After=syslog.target
    34
    45[Service]
  • init/bitlbee@.service.in

    r7a9d968 r3f44e43  
    11[Unit]
    22Description=BitlBee Per-Connection Server
     3After=syslog.target
    34
    45[Service]
    56ExecStart=@sbindir@bitlbee -I
    67StandardInput=socket
    7 StandardError=syslog
    88User=bitlbee
  • ipc.c

    r7a9d968 r3f44e43  
    898898        strcpy(un_addr.sun_path, IPCSOCKET);
    899899
    900         serversock = socket(AF_UNIX, SOCK_STREAM, 0);
     900        serversock = socket(AF_UNIX, SOCK_STREAM, PF_UNIX);
    901901
    902902        if (serversock == -1) {
  • irc.c

    r7a9d968 r3f44e43  
    2525
    2626#include "bitlbee.h"
    27 #include "canohost.h"
    2827#include "ipc.h"
    2928#include "dcc.h"
     
    4241{
    4342        irc_t *irc;
     43        struct sockaddr_storage sock;
     44        socklen_t socklen = sizeof(sock);
     45        char *host = NULL, *myhost = NULL;
    4446        irc_user_t *iu;
    4547        GSList *l;
     
    6264        irc->iconv = (GIConv) - 1;
    6365        irc->oconv = (GIConv) - 1;
     66
     67        if (global.conf->hostname) {
     68                myhost = g_strdup(global.conf->hostname);
     69        } else if (getsockname(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) {
     70                char buf[NI_MAXHOST + 1];
     71
     72                if (getnameinfo((struct sockaddr *) &sock, socklen, buf,
     73                                NI_MAXHOST, NULL, 0, 0) == 0) {
     74                        myhost = g_strdup(ipv6_unwrap(buf));
     75                }
     76        }
     77
     78        if (getpeername(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) {
     79                char buf[NI_MAXHOST + 1];
     80
     81                if (getnameinfo((struct sockaddr *) &sock, socklen, buf,
     82                                NI_MAXHOST, NULL, 0, 0) == 0) {
     83                        host = g_strdup(ipv6_unwrap(buf));
     84                }
     85        }
     86
     87        if (host == NULL) {
     88                host = g_strdup("localhost.localdomain");
     89        }
     90        if (myhost == NULL) {
     91                myhost = g_strdup("localhost.localdomain");
     92        }
    6493
    6594        if (global.conf->ping_interval > 0 && global.conf->ping_timeout > 0) {
     
    84113        s = set_add(&b->set, "last_version", "0", NULL, irc);
    85114        s->flags |= SET_HIDDEN;
     115        s = set_add(&b->set, "lcnicks", "true", set_eval_bool, irc);
    86116        s = set_add(&b->set, "nick_format", "%-@nick", NULL, irc);
    87         s = set_add(&b->set, "nick_lowercase", "false", set_eval_bool, irc);
    88         s = set_add(&b->set, "nick_underscores", "false", set_eval_bool, irc);
    89117        s = set_add(&b->set, "offline_user_quits", "true", set_eval_bool, irc);
    90118        s = set_add(&b->set, "ops", "both", set_eval_irc_channel_ops, irc);
     
    109137
    110138        irc->root = iu = irc_user_new(irc, ROOT_NICK);
     139        iu->host = g_strdup(myhost);
    111140        iu->fullname = g_strdup(ROOT_FN);
    112141        iu->f = &irc_user_root_funcs;
    113142
    114143        iu = irc_user_new(irc, NS_NICK);
     144        iu->host = g_strdup(myhost);
    115145        iu->fullname = g_strdup(ROOT_FN);
    116146        iu->f = &irc_user_root_funcs;
    117147
    118148        irc->user = g_new0(irc_user_t, 1);
    119        
    120         irc_set_hosts(irc, NULL, 0);
     149        irc->user->host = g_strdup(host);
    121150
    122151        conf_loaddefaults(irc);
     
    134163        }
    135164
     165        g_free(myhost);
     166        g_free(host);
     167
    136168        /* libpurple doesn't like fork()s after initializing itself, so this
    137169           is the right moment to initialize it. */
     
    153185
    154186        return irc;
    155 }
    156 
    157 void irc_set_hosts(irc_t *irc, const struct sockaddr *remote_addr, const socklen_t remote_addrlen)
    158 {
    159         struct sockaddr_storage sock;
    160         socklen_t socklen = sizeof(sock);
    161         char *host = NULL, *myhost = NULL;
    162         struct irc_user *iu;
    163 
    164         if (global.conf->hostname) {
    165                 myhost = g_strdup(global.conf->hostname);
    166         } else if (getsockname(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) {
    167                 myhost = reverse_lookup((struct sockaddr*) &sock, socklen);
    168         }
    169 
    170         if (remote_addrlen > 0) {
    171                 host = reverse_lookup(remote_addr, remote_addrlen);
    172         } else if (getpeername(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) {
    173                 host = reverse_lookup((struct sockaddr*) &sock, socklen);
    174         }
    175 
    176         if (myhost == NULL) {
    177                 myhost = g_strdup("localhost.localdomain");
    178         }
    179         if (host == NULL) {
    180                 host = g_strdup("localhost.localdomain");
    181         }
    182        
    183         if (irc->root->host != irc->root->nick) {
    184                 g_free(irc->root->host);
    185         }
    186         irc->root->host = g_strdup(myhost);
    187         if ((iu = irc_user_by_name(irc, NS_NICK))) {
    188                 if (iu->host != iu->nick) {
    189                         g_free(iu->host);
    190                 }
    191                 iu->host = g_strdup(myhost);
    192         }
    193        
    194         if (irc->user->host != irc->user->nick) {
    195                 g_free(irc->user->host);
    196         }
    197         irc->user->host = g_strdup(host);
    198 
    199         g_free(myhost);
    200         g_free(host);
    201187}
    202188
  • irc.h

    r7a9d968 r3f44e43  
    2626#ifndef _IRC_H
    2727#define _IRC_H
    28 
    29 #include <sys/socket.h>
    3028
    3129#define IRC_MAX_LINE 512
     
    273271
    274272irc_t *irc_new(int fd);
    275 void irc_set_hosts(irc_t *irc, const struct sockaddr *remote_addr, const socklen_t remote_addrlen);
    276273void irc_abort(irc_t *irc, int immed, char *format, ...) G_GNUC_PRINTF(3, 4);
    277274void irc_free(irc_t *irc);
  • irc_channel.c

    r7a9d968 r3f44e43  
    638638        irc_channel_name_strip(name);
    639639
    640         if (set_getbool(&irc->b->set, "nick_lowercase")) {
     640        if (set_getbool(&irc->b->set, "lcnicks")) {
    641641                nick_lc(irc, name + 1);
    642642        }
  • irc_commands.c

    r7a9d968 r3f44e43  
    2626#define BITLBEE_CORE
    2727#include "bitlbee.h"
    28 #include "canohost.h"
    2928#include "help.h"
    3029#include "ipc.h"
     
    5857                irc_check_login(irc);
    5958        }
    60 }
    61 
    62 /* http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
    63 
    64    This isn't actually IRC, it's used by for example stunnel4 to indicate
    65    the origin of the secured counterpart of the connection. It'll go wrong
    66    with arguments starting with : like for example "::1" but I guess I'm
    67    okay with that. */
    68 static void irc_cmd_proxy(irc_t *irc, char **cmd)
    69 {
    70         struct addrinfo hints, *ai;
    71         struct sockaddr_storage sock;
    72         socklen_t socklen = sizeof(sock);
    73 
    74         if (getpeername(irc->fd, (struct sockaddr*) &sock, &socklen) != 0) {
    75                 return;
    76         }
    77 
    78         ipv64_normalise_mapped(&sock, &socklen);
    79 
    80         /* Only accept PROXY "command" on localhost sockets. */
    81         if (!((sock.ss_family == AF_INET &&
    82                ntohl(((struct sockaddr_in*)&sock)->sin_addr.s_addr) == INADDR_LOOPBACK) ||
    83               (sock.ss_family == AF_INET6 &&
    84                IN6_IS_ADDR_LOOPBACK(&((struct sockaddr_in6*)&sock)->sin6_addr)))) {
    85                 return;
    86         }
    87 
    88         /* And only once. Do this with a pretty dumb regex-match for
    89            now, maybe better to use some sort of flag.. */
    90         if (!g_regex_match_simple("^(ip6-)?localhost(.(localdomain.?)?)?$", irc->user->host, 0, 0)) {
    91                 return;
    92         }
    93        
    94         memset(&hints, 0, sizeof(hints));
    95         hints.ai_flags = AI_NUMERICHOST;
    96         if (getaddrinfo(cmd[2], NULL, &hints, &ai) != 0) {
    97                 return;
    98         }
    99        
    100         irc_set_hosts(irc, ai->ai_addr, ai->ai_addrlen);
    101         freeaddrinfo(ai);
    10259}
    10360
     
    851808        { "cap",         1, irc_cmd_cap,         0 },
    852809        { "pass",        1, irc_cmd_pass,        0 },
    853         { "proxy",       5, irc_cmd_proxy,       IRC_CMD_PRE_LOGIN },
    854810        { "user",        4, irc_cmd_user,        IRC_CMD_PRE_LOGIN },
    855811        { "nick",        1, irc_cmd_nick,        0 },
  • irc_im.c

    r7a9d968 r3f44e43  
    8989
    9090        if (bu->flags & BEE_USER_LOCAL) {
    91                 char *s = set_getstr(&bu->ic->acc->set, "handle_unknown") ? :
    92                           set_getstr(&bee->set, "handle_unknown");
    93 
    94                 if (g_strcasecmp(s, "add_private") == 0) {
     91                char *s = set_getstr(&bee->set, "handle_unknown");
     92
     93                if (strcmp(s, "add_private") == 0) {
    9594                        iu->last_channel = NULL;
    96                 } else if (g_strcasecmp(s, "add_channel") == 0) {
     95                } else if (strcmp(s, "add_channel") == 0) {
    9796                        iu->last_channel = irc->default_channel;
    9897                }
     
    635634        }
    636635
     636        if (ic->flags & IRC_CHANNEL_JOINED) {
     637                irc_channel_printf(ic, "Cleaning up channel, bye!");
     638        }
     639
    637640        ic->data = NULL;
    638641        c->ui_data = NULL;
  • lib/Makefile

    r7a9d968 r3f44e43  
    1313
    1414# [SH] Program variables
    15 objects = arc.o base64.o canohost.o $(EVENT_HANDLER) ftutil.o http_client.o ini.o md5.o misc.o oauth.o oauth2.o parson.o proxy.o sha1.o $(SSL_CLIENT) url.o xmltree.o ns_parse.o
     15objects = arc.o base64.o $(EVENT_HANDLER) ftutil.o http_client.o ini.o md5.o misc.o oauth.o oauth2.o parson.o proxy.o sha1.o $(SSL_CLIENT) url.o xmltree.o ns_parse.o
    1616
    1717LFLAGS += -r
     
    3636lib.o: $(objects) $(subdirs)
    3737        @echo '*' Linking lib.o
    38         $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o lib.o
     38        @$(LD) $(LFLAGS) $(objects) -o lib.o
    3939
    4040$(objects): ../Makefile.settings Makefile
     
    4242$(objects): %.o: $(_SRCDIR_)%.c
    4343        @echo '*' Compiling $<
    44         $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
     44        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4545
    4646-include .depend/*.d
  • lib/ftutil.c

    r7a9d968 r3f44e43  
    4242        struct addrinfo hints, *rp;
    4343        socklen_t ssize = sizeof(struct sockaddr_storage);
    44         struct sockaddr_storage saddrs = {0}, *saddr = &saddrs;
     44        struct sockaddr_storage saddrs, *saddr = &saddrs;
    4545        static char errmsg[1024];
    4646        char *ftlisten = global.conf->ft_listen;
     
    6363                        if (for_bitlbee_client) {
    6464                                *scolon = '\0';
    65                                 strncpy(host, ftlisten, NI_MAXHOST);
     65                                strncpy(host, ftlisten, HOST_NAME_MAX);
    6666                                *scolon = ';';
    6767                        } else {
    68                                 strncpy(host, scolon + 1, NI_MAXHOST);
     68                                strncpy(host, scolon + 1, HOST_NAME_MAX);
    6969                        }
    7070                } else {
    71                         strncpy(host, ftlisten, NI_MAXHOST);
     71                        strncpy(host, ftlisten, HOST_NAME_MAX);
    7272                }
    7373
     
    7878        } else if (copy_fd >= 0 && getsockname(copy_fd, (struct sockaddr*) &saddrs, &ssize) == 0 &&
    7979                   (saddrs.ss_family == AF_INET || saddrs.ss_family == AF_INET6) &&
    80                    getnameinfo((struct sockaddr*) &saddrs, ssize, host, NI_MAXHOST,
     80                   getnameinfo((struct sockaddr*) &saddrs, ssize, host, HOST_NAME_MAX,
    8181                               NULL, 0, NI_NUMERICHOST) == 0) {
    8282                /* We just took our local address on copy_fd, which is likely to be a
     
    8484                   most sensible we can get easily. */
    8585        } else {
    86                 ASSERTSOCKOP(gethostname(host, NI_MAXHOST), "gethostname()");
     86                ASSERTSOCKOP(gethostname(host, HOST_NAME_MAX + 1), "gethostname()");
    8787        }
    8888
     
    109109                       ( void * ) &(( struct sockaddr_in * ) saddr)->sin_addr.s_addr :
    110110                       ( void * ) &(( struct sockaddr_in6 * ) saddr)->sin6_addr.s6_addr,
    111                        host, NI_MAXHOST)) {
     111                       host, HOST_NAME_MAX)) {
    112112                strcpy(errmsg, "inet_ntop failed on listening socket");
    113113                return -1;
     
    128128
    129129        /* I hate static-length strings.. */
    130         host[NI_MAXHOST - 1] = '\0';
     130        host[HOST_NAME_MAX - 1] = '\0';
    131131        port[5] = '\0';
    132132
  • lib/ftutil.h

    r7a9d968 r3f44e43  
    2626#endif
    2727
     28/* Some ifdefs for ulibc and apparently also BSD (Thanks to Whoopie) */
     29#ifndef HOST_NAME_MAX
     30#include <sys/param.h>
     31#ifdef MAXHOSTNAMELEN
     32#define HOST_NAME_MAX MAXHOSTNAMELEN
     33#else
     34#define HOST_NAME_MAX 255
     35#endif
     36#endif
     37
    2838/* This function should be used with care. host should be AT LEAST a
    29    char[NI_MAXHOST+1] and port AT LEAST a char[6]. */
     39   char[HOST_NAME_MAX+1] and port AT LEAST a char[6]. */
    3040int ft_listen(struct sockaddr_storage *saddr_ptr, char *host, char *port, int copy_fd, int for_bitlbee_client,
    3141              char **errptr);
  • lib/misc.c

    r7a9d968 r3f44e43  
    1   /********************************************************************\
     1/********************************************************************\
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
     
    335335}
    336336
     337/* Wrap an IPv4 address into IPv6 space. Not thread-safe... */
     338char *ipv6_wrap(char *src)
     339{
     340        static char dst[64];
     341        int i;
     342
     343        for (i = 0; src[i]; i++) {
     344                if ((src[i] < '0' || src[i] > '9') && src[i] != '.') {
     345                        break;
     346                }
     347        }
     348
     349        /* Hmm, it's not even an IP... */
     350        if (src[i]) {
     351                return src;
     352        }
     353
     354        g_snprintf(dst, sizeof(dst), "::ffff:%s", src);
     355
     356        return dst;
     357}
     358
     359/* Unwrap an IPv4 address into IPv6 space. Thread-safe, because it's very simple. :-) */
     360char *ipv6_unwrap(char *src)
     361{
     362        int i;
     363
     364        if (g_strncasecmp(src, "::ffff:", 7) != 0) {
     365                return src;
     366        }
     367
     368        for (i = 7; src[i]; i++) {
     369                if ((src[i] < '0' || src[i] > '9') && src[i] != '.') {
     370                        break;
     371                }
     372        }
     373
     374        /* Hmm, it's not even an IP... */
     375        if (src[i]) {
     376                return src;
     377        }
     378
     379        return (src + 7);
     380}
     381
    337382/* Convert from one charset to another.
    338383
  • lib/misc.h

    r7a9d968 r3f44e43  
    2929#include <gmodule.h>
    3030#include <time.h>
    31 #include <sys/socket.h>
    3231
    3332struct ns_srv_reply {
     
    131130G_MODULE_EXPORT void http_encode(char *s);
    132131
     132G_MODULE_EXPORT char *ipv6_wrap(char *src);
     133G_MODULE_EXPORT char *ipv6_unwrap(char *src);
     134
    133135G_MODULE_EXPORT signed int do_iconv(char *from_cs, char *to_cs, char *src, char *dst, size_t size, size_t maxbuf);
    134136
  • nick.c

    r7a9d968 r3f44e43  
    9494
    9595                nick_strip(irc, nick);
    96                 if (set_getbool(&bu->bee->set, "nick_lowercase")) {
     96                if (set_getbool(&bu->bee->set, "lcnicks")) {
    9797                        nick_lc(irc, nick);
    9898                }
     
    215215        if (ok && rets && *rets) {
    216216                nick_strip(irc, rets);
    217 
    218                 if (set_getbool(&bu->bee->set, "nick_lowercase")) {
    219                         nick_lc(irc, rets);
    220                 }
    221 
    222217                truncate_utf8(rets, MAX_NICK_LENGTH);
    223218                return rets;
     
    293288{
    294289        int len = 0;
    295         gboolean nick_underscores = irc ? set_getbool(&irc->b->set, "nick_underscores") : FALSE;
    296290
    297291        if (irc && (irc->status & IRC_UTF8_NICKS)) {
     
    303297                        n = g_utf8_find_next_char(p, NULL);
    304298
    305                         if (nick_underscores && c == ' ') {
    306                                 *p = '_';
    307                                 p = n;
    308                         } else if ((c < 0x7f && !(strchr(nick_lc_chars, c) ||
    309                                                   strchr(nick_uc_chars, c))) ||
     299                        if ((c < 0x7f && !(strchr(nick_lc_chars, c) ||
     300                                           strchr(nick_uc_chars, c))) ||
    310301                            !g_unichar_isgraph(c)) {
    311302                                strcpy(tmp, n);
     
    322313
    323314                for (i = len = 0; nick[i] && len < MAX_NICK_LENGTH; i++) {
    324                         if (nick_underscores && nick[i] == ' ') {
    325                                 nick[len] = '_';
    326                                 len++;
    327                         } else if (strchr(nick_lc_chars, nick[i]) ||
     315                        if (strchr(nick_lc_chars, nick[i]) ||
    328316                            strchr(nick_uc_chars, nick[i])) {
    329317                                nick[len] = nick[i];
  • otr.c

    r7a9d968 r3f44e43  
    878878        case OTRL_SMPEVENT_ASK_FOR_SECRET:
    879879                irc_rootmsg(irc, "smp: initiated by %s"
    880                             " - respond with \x02otr smp %s \"<secret>\"\x02",
     880                            " - respond with \x02otr smp %s <secret>\x02",
    881881                            u->nick, u->nick);
    882882                break;
     
    884884                irc_rootmsg(irc, "smp: initiated by %s with question: \x02\"%s\"\x02", u->nick,
    885885                            question);
    886                 irc_rootmsg(irc, "smp: respond with \x02otr smp %s \"<answer>\"\x02",
     886                irc_rootmsg(irc, "smp: respond with \x02otr smp %s <answer>\x02",
    887887                            u->nick);
    888888                break;
     
    15141514                        }
    15151515                }
    1516                 g_return_val_if_fail(l, NULL);
     1516                assert(l != NULL);  /* a match should always be found */
    15171517                if (!l) {
    15181518                        return NULL;
  • protocols/Makefile

    r7a9d968 r3f44e43  
    4343
    4444$(subdirs):
    45         $(MAKE) -C $@ $(MAKECMDGOALS)
     45        @$(MAKE) -C $@ $(MAKECMDGOALS)
    4646
    4747### MAIN PROGRAM
     
    4949protocols.o: $(objects) $(subdirs)
    5050        @echo '*' Linking protocols.o
    51         $(VERBOSE) $(LD) $(LFLAGS) $(objects) $(subdirobjs) -o protocols.o
     51        @$(LD) $(LFLAGS) $(objects) $(subdirobjs) -o protocols.o
    5252
    5353$(objects): ../Makefile.settings Makefile
     
    5555$(objects): %.o: $(_SRCDIR_)%.c
    5656        @echo '*' Compiling $<
    57         $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
     57        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    5858
    5959-include .depend/*.d
  • protocols/account.c

    r7a9d968 r3f44e43  
    5555
    5656        s = set_add(&a->set, "auto_reconnect", "true", set_eval_bool, a);
    57 
    58         s = set_add(&a->set, "handle_unknown", NULL, NULL, a);
    59         s->flags |= SET_NULL_OK;
    6057
    6158        s = set_add(&a->set, "nick_format", NULL, NULL, a);
  • protocols/bee_user.c

    r7a9d968 r3f44e43  
    170170
    171171        if (!(bu = bee_user_by_handle(bee, ic, handle))) {
    172                 char *h = set_getstr(&ic->acc->set, "handle_unknown") ? :
    173                           set_getstr(&ic->bee->set, "handle_unknown");
    174 
    175                 if (g_strncasecmp(h, "add", 3) == 0) {
     172                if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "add") == 0) {
    176173                        bu = bee_user_new(bee, ic, handle, BEE_USER_LOCAL);
    177174                } else {
    178                         if (g_strcasecmp(h, "ignore") != 0) {
     175                        if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "ignore") != 0) {
    179176                                imcb_log(ic, "imcb_buddy_status() for unknown handle %s:\n"
    180177                                         "flags = %d, state = %s, message = %s", handle, flags,
     
    258255
    259256        if (!bu && !(ic->flags & OPT_LOGGING_OUT)) {
    260                 char *h = set_getstr(&ic->acc->set, "handle_unknown") ? :
    261                           set_getstr(&ic->bee->set, "handle_unknown");
     257                char *h = set_getstr(&bee->set, "handle_unknown");
    262258
    263259                if (g_strcasecmp(h, "ignore") == 0) {
  • protocols/jabber/Makefile

    r7a9d968 r3f44e43  
    3838$(objects): %.o: $(_SRCDIR_)%.c
    3939        @echo '*' Compiling $<
    40         $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
     40        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4141
    4242jabber_mod.o: $(objects)
    4343        @echo '*' Linking jabber_mod.o
    44         $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o jabber_mod.o
     44        @$(LD) $(LFLAGS) $(objects) -o jabber_mod.o
    4545
    4646-include .depend/*.d
  • protocols/jabber/conference.c

    r7a9d968 r3f44e43  
    167167        jabber_buddy_remove_bare(c->ic, jc->name);
    168168
    169         g_free(jc->last_sent_message);
    170169        g_free(jc->my_full_jid);
    171170        g_free(jc->name);
     
    188187
    189188        jabber_cache_add(ic, node, jabber_chat_self_message);
    190 
    191         g_free(jc->last_sent_message);
    192         jc->last_sent_message = g_strdup(message);
    193189
    194190        return !jabber_write_packet(ic, node);
     
    329325                        }
    330326                        bud->flags |= JBFLAG_IS_ANONYMOUS;
    331                 } else if (bud == jc->me) {
    332                         g_free(bud->ext_jid);
    333                         bud->ext_jid = g_strdup(jd->me);
    334327                }
    335328
     
    354347                }
    355348
    356                 imcb_chat_add_buddy(chat, bud->ext_jid);
    357 
    358349                if (bud != jc->me && (jc->flags & JCFLAG_ALWAYS_USE_NICKS) && !(bud->flags & JBFLAG_IS_ANONYMOUS)) {
    359350                        imcb_buddy_nick_change(ic, bud->ext_jid, bud->resource);
    360351                }
    361352
     353                imcb_chat_add_buddy(chat, bud->ext_jid);
    362354                if (s) {
    363355                        *s = '/';
     
    502494                imcb_chat_log(chat, "From conference server: %s", body->text);
    503495                return;
    504         } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me) {
    505                 if (jabber_cache_handle_packet(ic, node) == XT_ABORT) {
    506                         /* Self message marked by this bitlbee, don't show it */
    507                         return;
    508                 } else if (xt_find_attr(node, "id") == NULL &&
    509                            g_strcmp0(body->text, jc->last_sent_message) == 0) {
    510                         /* Some misbehaving servers (like slack) eat the ids and echo anyway.
    511                          * Try to detect those cases by comparing against the last sent message. */
    512                         return;
    513                 }
     496        } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me &&
     497                   (jabber_cache_handle_packet(ic, node) == XT_ABORT)) {
     498                /* Self message marked by this bitlbee, don't show it */
     499                return;
    514500        }
    515501
  • protocols/jabber/jabber.h

    r7a9d968 r3f44e43  
    161161        struct jabber_buddy *me;
    162162        char *invite;
    163         char *last_sent_message;
    164163};
    165164
  • protocols/jabber/s5bytestream.c

    r7a9d968 r3f44e43  
    500500        case BS_PHASE_REPLY:
    501501        {
    502                 struct socks5_message socks5_reply = {0};
     502                struct socks5_message socks5_reply;
    503503                int ret;
    504504
     
    888888        char *proxy, *next, *errmsg = NULL;
    889889        char port[6];
    890         char host[NI_MAXHOST + 1];
     890        char host[HOST_NAME_MAX + 1];
    891891        jabber_streamhost_t *sh, *sh2;
    892892        GSList *streamhosts = jd->streamhosts;
     
    10461046                        unsigned char nmethods;
    10471047                        unsigned char method;
    1048                 } socks5_hello = {0};
     1048                } socks5_hello;
    10491049
    10501050                if (!(ret = jabber_bs_peek(bt, &socks5_hello, sizeof(socks5_hello)))) {
     
    10911091        case BS_PHASE_REQUEST:
    10921092        {
    1093                 struct socks5_message socks5_connect = {0};
     1093                struct socks5_message socks5_connect;
    10941094                int msgsize = sizeof(struct socks5_message);
    10951095                int ret;
  • protocols/msn/Makefile

    r7a9d968 r3f44e43  
    3838$(objects): %.o: $(_SRCDIR_)%.c
    3939        @echo '*' Compiling $<
    40         $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
     40        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4141
    4242msn_mod.o: $(objects)
    4343        @echo '*' Linking msn_mod.o
    44         $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o msn_mod.o
     44        @$(LD) $(LFLAGS) $(objects) -o msn_mod.o
    4545
    4646-include .depend/*.d
  • protocols/msn/msn_util.c

    r7a9d968 r3f44e43  
    180180        if (getenv("BITLBEE_DEBUG")) {
    181181                fprintf(stderr, "\n\x1b[92m<<< ");
    182                 fwrite(bytes, st, 1, stderr);
     182                write(2, bytes , st);
    183183                fprintf(stderr, "\x1b[97m");
    184184        }
  • protocols/msn/soap.c

    r7a9d968 r3f44e43  
    213213        if (headers) {
    214214                if ((s = strstr(headers, "\r\n\r\n"))) {
    215                         fwrite(headers, s - headers + 4, 1, stderr);
     215                        write(2, headers, s - headers + 4);
    216216                } else {
    217                         fwrite(headers, strlen(headers), 1, stderr);
     217                        write(2, headers, strlen(headers));
    218218                }
    219219        }
  • protocols/nogaim.c

    r7a9d968 r3f44e43  
    5050}
    5151
    52 /* semi-private */
    53 gboolean plugin_info_validate(struct plugin_info *info, const char *path)
     52gboolean load_plugin(char *path)
    5453{
    5554        GList *l;
    56         gboolean loaded = FALSE;
    57 
    58         if (!path) {
    59                 path = "(null)";
    60         }
    61 
    62         if (info->abiver != BITLBEE_ABI_VERSION_CODE) {
    63                 log_message(LOGLVL_ERROR,
    64                             "`%s' uses ABI %u but %u is required\n",
    65                             path, info->abiver,
    66                             BITLBEE_ABI_VERSION_CODE);
    67                 return FALSE;
    68         }
    69 
    70         if (!info->name || !info->version) {
    71                 log_message(LOGLVL_ERROR,
    72                             "Name or version missing from the "
    73                             "plugin info in `%s'\n", path);
    74                 return FALSE;
    75         }
    76 
    77         for (l = plugins; l; l = l->next) {
    78                 struct plugin_info *i = l->data;
    79 
    80                 if (g_strcasecmp(i->name, info->name) == 0) {
    81                         loaded = TRUE;
    82                         break;
    83                 }
    84         }
    85 
    86         if (loaded) {
    87                 log_message(LOGLVL_WARNING,
    88                             "%s plugin already loaded\n",
    89                             info->name);
    90                 return FALSE;
    91         }
    92 
    93         return TRUE;
    94 }
    95 
    96 /* semi-private */
    97 gboolean plugin_info_add(struct plugin_info *info)
    98 {
    99         plugins = g_list_insert_sorted_with_data(plugins, info, pluginscmp, NULL);
    100         return TRUE;
    101 }
    102 
    103 gboolean load_plugin(char *path)
    104 {
    105         struct plugin_info *info = NULL;
     55        struct plugin_info *i;
     56        struct plugin_info *info;
    10657        struct plugin_info * (*info_function) (void) = NULL;
    10758        void (*init_function) (void);
    10859
    10960        GModule *mod = g_module_open(path, G_MODULE_BIND_LAZY);
     61        gboolean loaded = FALSE;
    11062
    11163        if (!mod) {
     
    11769                info = info_function();
    11870
    119                 if (!plugin_info_validate(info, path)) {
     71                if (info->abiver != BITLBEE_ABI_VERSION_CODE) {
     72                        log_message(LOGLVL_ERROR,
     73                                    "`%s' uses ABI %u but %u is required\n",
     74                                    path, info->abiver,
     75                                    BITLBEE_ABI_VERSION_CODE);
     76                        g_module_close(mod);
     77                        return FALSE;
     78                }
     79
     80                if (!info->name || !info->version) {
     81                        log_message(LOGLVL_ERROR,
     82                                    "Name or version missing from the "
     83                                    "plugin info in `%s'\n", path);
     84                        g_module_close(mod);
     85                        return FALSE;
     86                }
     87
     88                for (l = plugins; l; l = l->next) {
     89                        i = l->data;
     90
     91                        if (g_strcasecmp(i->name, info->name) == 0) {
     92                                loaded = TRUE;
     93                                break;
     94                        }
     95                }
     96
     97                if (loaded) {
     98                        log_message(LOGLVL_WARNING,
     99                                    "%s plugin already loaded\n",
     100                                    info->name);
    120101                        g_module_close(mod);
    121102                        return FALSE;
     
    132113
    133114        if (info_function) {
    134                 plugin_info_add(info);
     115                plugins = g_list_insert_sorted_with_data(plugins, info,
     116                                                         pluginscmp, NULL);
    135117        }
    136118
     
    815797                msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL;
    816798                away = imc_away_state_find(m, away, &msg) ? :
    817                        (imc_away_state_find(m, "away", NULL) ? : m->data);
     799                       (imc_away_state_find(m, "away", &msg) ? : m->data);
    818800        } else if (ic->acc->flags & ACC_FLAG_STATUS_MESSAGE) {
    819801                away = NULL;
     
    849831                           contains no data unless it adds something to what
    850832                           we have in state already. */
    851                         if (message && strlen(m->data) == strlen(away)) {
     833                        if (strlen(m->data) == strlen(away)) {
    852834                                *message = NULL;
    853835                        }
     
    875857                        for (m = gcm; m; m = m->next) {
    876858                                if (g_strcasecmp(imc_away_alias_list[i][j], m->data) == 0) {
    877                                         if (!keep_message && message) {
     859                                        if (!keep_message) {
    878860                                                *message = NULL;
    879861                                        }
  • protocols/oscar/Makefile

    r7a9d968 r3f44e43  
    3939$(objects): %.o: $(_SRCDIR_)%.c
    4040        @echo '*' Compiling $<
    41         $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
     41        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4242
    4343oscar_mod.o: $(objects)
    4444        @echo '*' Linking oscar_mod.o
    45         $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o oscar_mod.o
     45        @$(LD) $(LFLAGS) $(objects) -o oscar_mod.o
    4646
    4747-include .depend/*.d
  • protocols/oscar/rxhandlers.c

    r7a9d968 r3f44e43  
    235235        struct aim_rxcblist_s *newcb;
    236236
    237         g_return_val_if_fail(conn, -1);
    238         g_return_val_if_fail(!checkdisallowed(family, type), -1);
     237        if (!conn) {
     238                return -1;
     239        }
     240
     241        if (checkdisallowed(family, type)) {
     242                g_assert(0);
     243                return -1;
     244        }
    239245
    240246        if (!(newcb = (struct aim_rxcblist_s *) g_new0(struct aim_rxcblist_s, 1))) {
  • protocols/purple/Makefile

    r7a9d968 r3f44e43  
    3939$(objects): %.o: $(_SRCDIR_)%.c
    4040        @echo '*' Compiling $<
    41         $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
     41        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4242
    4343purple_mod.o: $(objects)
    4444        @echo '*' Linking purple_mod.o
    45         $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o purple_mod.o
     45        @$(LD) $(LFLAGS) $(objects) -o purple_mod.o
    4646
    4747-include .depend/*.d
  • protocols/purple/bpurple.h

    r7a9d968 r3f44e43  
    66
    77#define PURPLE_REQUEST_HANDLE "purple_request"
    8 
    9 #define PURPLE_OPT_SHOULD_SET_NICK 1
    108
    119struct purple_data
     
    1715    char *chat_list_server;
    1816    GSList *filetransfers;
    19 
    20     int flags;
    2117};
    2218
  • protocols/purple/ft.c

    r7a9d968 r3f44e43  
    146146           remove the evil cast below. */
    147147        px->ft = imcb_file_send_start(ic, (char *) who, xfer->filename, xfer->size);
    148 
    149         if (!px->ft) {
    150                 return FALSE;
    151         }
    152148        px->ft->data = px;
    153149
  • protocols/purple/purple.c

    r7a9d968 r3f44e43  
    114114}
    115115
    116 static gboolean purple_account_should_set_nick(account_t *acc)
    117 {
    118         /* whitelist of protocols that tend to have numeric or meaningless usernames, and should
    119          * always offer the 'alias' as a nick.  this is just so that users don't have to do
    120          * 'account whatever set nick_format %full_name'
    121          */
    122         char *whitelist[] = {
    123                 "prpl-hangouts",
    124                 "prpl-eionrobb-funyahoo-plusplus",
    125                 "prpl-icq",
    126                 "prpl-line",
    127                 NULL,
    128         };
    129         char **p;
    130 
    131         for (p = whitelist; *p; p++) {
    132                 if (g_strcmp0(acc->prpl->data, *p) == 0) {
    133                         return TRUE;
    134                 }
    135         }
    136 
    137         return FALSE;
    138 }
    139 
    140116static void purple_init(account_t *acc)
    141117{
     
    305281        }
    306282
    307         if (g_strcmp0(prpl->info->id, "prpl-line") == 0) {
    308                 s = set_add(&acc->set, "line-auth-token", NULL, NULL, acc);
    309                 s->flags |= SET_HIDDEN;
    310         }
    311 
    312283        /* Go through all away states to figure out if away/status messages
    313284           are possible. */
     
    373344                purple_account_set_check_mail(pa, set_getbool(&acc->set, "mail_notifications"));
    374345        }
    375 
    376         if (g_strcmp0(prpl->info->id, "prpl-line") == 0) {
    377                 const char *name = "line-auth-token";
    378                 purple_account_set_string(pa, name, set_getstr(&acc->set, name));
    379         }
    380346}
    381347
     
    406372        purple_account_set_password(pd->account, acc->pass);
    407373        purple_sync_settings(acc, pd->account);
    408 
    409         if (purple_account_should_set_nick(acc)) {
    410                 pd->flags = PURPLE_OPT_SHOULD_SET_NICK;
    411         }
    412374
    413375        purple_account_set_enabled(pd->account, "BitlBee", TRUE);
     
    779741        struct groupchat *gc;
    780742        GList *info, *l;
    781         GString *missing_settings = NULL;
    782743
    783744        if (!pi->chat_info || !pi->chat_info_defaults ||
     
    805766                } else if (strcmp(pce->identifier, "passwd") == 0) {
    806767                        g_hash_table_replace(chat_hash, "passwd", g_strdup(password));
    807                 } else {
    808                         char *key, *value;
    809 
    810                         key = g_strdup_printf("purple_%s", pce->identifier);
    811                         str_reject_chars(key, " -", '_');
    812 
    813                         if ((value = set_getstr(sets, key))) {
    814                                 /* sync from bitlbee to the prpl */
    815                                 g_hash_table_replace(chat_hash, (char *) pce->identifier, g_strdup(value));
    816                         } else if ((value = g_hash_table_lookup(chat_hash, pce->identifier))) {
    817                                 /* if the bitlbee one was empty, sync from prpl to bitlbee */
    818                                 set_setstr(sets, key, value);
    819                         }
    820 
    821                         g_free(key);
    822                 }
    823 
    824                 if (pce->required && !g_hash_table_lookup(chat_hash, pce->identifier)) {
    825                         if (!missing_settings) {
    826                                 missing_settings = g_string_sized_new(32);
    827                         }
    828                         g_string_append_printf(missing_settings, "%s, ", pce->identifier);
    829768                }
    830769
     
    833772
    834773        g_list_free(info);
    835 
    836         if (missing_settings) {
    837                 /* remove the ", " from the end */
    838                 g_string_truncate(missing_settings, missing_settings->len - 2);
    839 
    840                 imcb_error(ic, "Can't join %s. The following settings are required: %s", room, missing_settings->str);
    841 
    842                 g_string_free(missing_settings, TRUE);
    843                 g_hash_table_destroy(chat_hash);
    844                 return NULL;
    845         }
    846774
    847775        /* do this before serv_join_chat to handle cases where prplcb_conv_new is called immediately (not async) */
     
    878806                purple_roomlist_ref(list);
    879807        }
    880 }
    881 
    882 /* handles either prpl->chat_(add|free)_settings depending on the value of 'add' */
    883 static void purple_chat_update_settings(account_t *acc, set_t **head, gboolean add)
    884 {
    885         PurplePlugin *prpl = purple_plugins_find_with_id((char *) acc->prpl->data);
    886         PurplePluginProtocolInfo *pi = prpl->info->extra_info;
    887         GList *info, *l;
    888 
    889         if (!pi->chat_info || !pi->chat_info_defaults) {
    890                 return;
    891         }
    892 
    893         /* hack / leap of faith: pass a NULL here because we don't have a connection yet.
    894          * i reviewed all the built-in prpls and a bunch of third-party ones and none
    895          * of them seem to need this parameter at all, so... i hope it never crashes */
    896         info = pi->chat_info(NULL);
    897 
    898         for (l = info; l; l = l->next) {
    899                 struct proto_chat_entry *pce = l->data;
    900                 char *key;
    901 
    902                 if (strcmp(pce->identifier, "handle") == 0 ||
    903                     strcmp(pce->identifier, "password") == 0 ||
    904                     strcmp(pce->identifier, "passwd") == 0) {
    905                         /* skip these, they are handled above */
    906                         g_free(pce);
    907                         continue;
    908                 }
    909 
    910                 key = g_strdup_printf("purple_%s", pce->identifier);
    911                 str_reject_chars(key, " -", '_');
    912 
    913                 if (add) {
    914                         set_add(head, key, NULL, NULL, NULL);
    915                 } else {
    916                         set_del(head, key);
    917                 }
    918 
    919                 g_free(key);
    920                 g_free(pce);
    921         }
    922 
    923         g_list_free(NULL);
    924         g_list_free(info);
    925 }
    926 
    927 static void purple_chat_add_settings(account_t *acc, set_t **head)
    928 {
    929         purple_chat_update_settings(acc, head, TRUE);
    930 }
    931 
    932 static void purple_chat_free_settings(account_t *acc, set_t **head)
    933 {
    934         purple_chat_update_settings(acc, head, FALSE);
    935808}
    936809
     
    971844{
    972845        struct im_connection *ic = purple_ic_by_gc(gc);
    973         struct purple_data *pd = ic->proto_data;
    974         const char *dn, *token;
     846        const char *dn;
    975847        set_t *s;
    976848
     
    985857        // user list needs to be requested for Gadu-Gadu
    986858        purple_gg_buddylist_import(gc);
    987 
    988         /* more awful hacks, because clearly we didn't have enough of those */
    989         if ((s = set_find(&ic->acc->set, "line-auth-token")) &&
    990             (token = purple_account_get_string(pd->account, "line-auth-token", NULL))) {
    991                 g_free(s->value);
    992                 s->value = g_strdup(token);
    993         }
    994859
    995860        ic->flags |= OPT_DOES_HTML;
     
    1043908                PurpleGroup *group = purple_buddy_get_group(bud);
    1044909                struct im_connection *ic = purple_ic_by_pa(bud->account);
    1045                 struct purple_data *pd = ic->proto_data;
    1046910                PurpleStatus *as;
    1047911                int flags = 0;
    1048                 char *alias = NULL;
    1049912
    1050913                if (ic == NULL) {
     
    1052915                }
    1053916
    1054                 alias = bud->server_alias ? : bud->alias;
    1055 
    1056                 if (alias) {
    1057                         imcb_rename_buddy(ic, bud->name, alias);
    1058                         if (pd->flags & PURPLE_OPT_SHOULD_SET_NICK) {
    1059                                 imcb_buddy_nick_change(ic, bud->name, alias);
    1060                         }
     917                if (bud->server_alias) {
     918                        imcb_rename_buddy(ic, bud->name, bud->server_alias);
     919                } else if (bud->alias) {
     920                        imcb_rename_buddy(ic, bud->name, bud->alias);
    1061921                }
    1062922
     
    12021062}
    12031063
    1204 /* Handles write_im and write_chat. Removes echoes of locally sent messages.
    1205  *
    1206  * PURPLE_MESSAGE_DELAYED is used for chat backlogs - if a message has both
    1207  * that flag and _SEND, it's a self-message from before joining the channel.
    1208  * Those are safe to display. The rest (with just _SEND) may be echoes. */
     1064/* Handles write_im and write_chat. Removes echoes of locally sent messages */
    12091065static void prplcb_conv_msg(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime)
    12101066{
    1211         if ((!(flags & PURPLE_MESSAGE_SEND)) || (flags & PURPLE_MESSAGE_DELAYED)) {
    1212                 handle_conv_msg(conv, who, message, (flags & PURPLE_MESSAGE_SEND) ? OPT_SELFMESSAGE : 0, mtime);
     1067        if (!(flags & PURPLE_MESSAGE_SEND)) {
     1068                handle_conv_msg(conv, who, message, 0, mtime);
    12131069        }
    12141070}
     
    15361392}
    15371393
    1538 static char *prplcb_roomlist_get_room_name(PurpleRoomlist *list, PurpleRoomlistRoom *room)
    1539 {
    1540         struct im_connection *ic = purple_ic_by_pa(list->account);
    1541         struct purple_data *pd = ic->proto_data;
    1542         PurplePlugin *prpl = purple_plugins_find_with_id(pd->account->protocol_id);
    1543         PurplePluginProtocolInfo *pi = prpl->info->extra_info;
    1544 
    1545         if (pi && pi->roomlist_room_serialize) {
    1546                 return pi->roomlist_room_serialize(room);
    1547         } else {
    1548                 return g_strdup(purple_roomlist_room_get_name(room));
    1549         }
    1550 }
    1551 
    15521394static void prplcb_roomlist_add_room(PurpleRoomlist *list, PurpleRoomlistRoom *room)
    15531395{
    15541396        bee_chat_info_t *ci;
    1555         char *title;
     1397        const char *title;
    15561398        const char *topic;
    15571399        GList *fields;
     
    15591401
    15601402        fields = purple_roomlist_room_get_fields(room);
    1561         title = prplcb_roomlist_get_room_name(list, room);
     1403        title = purple_roomlist_room_get_name(room);
    15621404
    15631405        if (rld->topic >= 0) {
     
    15681410
    15691411        ci = g_new(bee_chat_info_t, 1);
    1570         ci->title = title;
     1412        ci->title = g_strdup(title);
    15711413        ci->topic = g_strdup(topic);
    15721414        rld->chats = g_slist_prepend(rld->chats, ci);
     
    17901632}
    17911633
    1792 /* borrowing this semi-private function
    1793  * TODO: figure out a better interface later (famous last words) */
    1794 gboolean plugin_info_add(struct plugin_info *info);
    1795 
    17961634void purple_initmodule()
    17971635{
     
    18001638        GString *help;
    18011639        char *dir;
    1802         gboolean debug_enabled = !!getenv("BITLBEE_DEBUG");
    18031640
    18041641        if (purple_get_core() != NULL) {
     
    18081645        }
    18091646
    1810         g_return_if_fail((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ);
    1811         g_return_if_fail((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE);
     1647        g_assert((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ);
     1648        g_assert((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE);
    18121649
    18131650        dir = g_strdup_printf("%s/purple", global.conf->configdir);
     
    18191656        g_free(dir);
    18201657
    1821         purple_debug_set_enabled(debug_enabled);
     1658        purple_debug_set_enabled(FALSE);
    18221659        purple_core_set_ui_ops(&bee_core_uiops);
    18231660        purple_eventloop_set_ui_ops(&glib_eventloops);
     
    18271664                abort();
    18281665        }
    1829         purple_debug_set_enabled(FALSE);
    18301666
    18311667        if (proxytype != PROXY_NONE) {
     
    18861722        funcs.chat_join = purple_chat_join;
    18871723        funcs.chat_list = purple_chat_list;
    1888         funcs.chat_add_settings = purple_chat_add_settings;
    1889         funcs.chat_free_settings = purple_chat_free_settings;
    18901724        funcs.transfer_request = purple_transfer_request;
    18911725
     
    18981732                PurplePluginProtocolInfo *pi = prot->info->extra_info;
    18991733                struct prpl *ret;
    1900                 struct plugin_info *info;
    19011734
    19021735                /* If we already have this one (as a native module), don't
     
    19331766                        register_protocol(ret);
    19341767                }
    1935 
    1936                 info = g_new0(struct plugin_info, 1);
    1937                 info->abiver = BITLBEE_ABI_VERSION_CODE;
    1938                 info->name = ret->name;
    1939                 info->version = prot->info->version;
    1940                 info->description = prot->info->description;
    1941                 info->author = prot->info->author;
    1942                 info->url = prot->info->homepage;
    1943 
    1944                 plugin_info_add(info);
    19451768        }
    19461769
  • protocols/twitter/Makefile

    r7a9d968 r3f44e43  
    3838$(objects): %.o: $(_SRCDIR_)%.c
    3939        @echo '*' Compiling $<
    40         $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
     40        @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@
    4141
    4242twitter_mod.o: $(objects)
    4343        @echo '*' Linking twitter_mod.o
    44         $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o twitter_mod.o
     44        @$(LD) $(LFLAGS) $(objects) -o twitter_mod.o
    4545       
    4646-include .depend/*.d
  • protocols/twitter/twitter.c

    r7a9d968 r3f44e43  
    576576        s->flags |= SET_HIDDEN | SET_NOSAVE;
    577577
    578         s = set_add(&acc->set, "in_korea", "false", set_eval_bool, acc);
    579         s->flags |= SET_HIDDEN;
    580 
    581578        if (strcmp(acc->prpl->name, "twitter") == 0) {
    582579                s = set_add(&acc->set, "stream", "true", set_eval_bool, acc);
  • protocols/twitter/twitter_lib.c

    r7a9d968 r3f44e43  
    239239        if ((ret = json_parse_string(req->reply_body)) == NULL) {
    240240                imcb_error(ic, "Could not retrieve %s: %s",
    241                            path, "JSON parse error");
     241                           path, "XML parse error");
    242242        }
    243243        return ret;
     
    310310
    311311                txl->list = g_slist_prepend(txl->list,
    312                                             g_strdup_printf("%" PRIu64, id);
     312                                            g_strdup_printf("%lld", id));
    313313        }
    314314
     
    443443        txl = g_new0(struct twitter_xml_list, 1);
    444444        txl->list = td->noretweets_ids;
    445 
     445       
    446446        // Process the retweet ids
    447447        txl->type = TXL_ID;
     
    452452                        jint id = json_array_get_integer(arr, i);
    453453                        txl->list = g_slist_prepend(txl->list,
    454                                                     g_strdup_printf("%" PRId64, id));
     454                                                    g_strdup_printf("%lld", id));
    455455                }
    456456        }
     
    713713                return;
    714714        if ((quoted = json_object_get_object(node, "quoted_status"))) {
    715                 /* New "retweets with comments" feature. Grab the
     715                /* New "retweets with comments" feature. Note that this info
     716                 * seems to be included in the streaming API only! Grab the
    716717                 * full message and try to insert it when we run into the
    717718                 * Tweet entity. */
     
    754755                        char *pos, *new;
    755756
    756                         /* Skip if a required field is missing, if the t.co URL is not in fact
    757                            in the Tweet at all, or if the full-ish one *is* in it already
    758                            (dupes appear, especially in streaming API). */
    759                         if (!kort || !disp || !(pos = strstr(*text, kort)) || strstr(*text, disp)) {
     757                        if (!kort || !disp || !(pos = strstr(*text, kort))) {
    760758                                continue;
    761759                        }
     
    982980                return;
    983981        }
    984 
     982       
    985983        /* Check this is not a tweet that should be muted */
    986984        uid_str = g_strdup_printf("%" G_GUINT64_FORMAT, status->user->uid);
     
    16931691        };
    16941692
    1695         if (set_getbool(&ic->acc->set, "in_korea") && !in_reply_to) {
    1696                 g_free(args[3]);
    1697                 args[2] = "place_id";
    1698                 args[3] = g_strdup("c999e6a453e9ef72");
    1699                 in_reply_to = 1;
    1700         }
    1701 
    17021693        twitter_http(ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1,
    17031694                     args, in_reply_to ? 4 : 2);
  • root_commands.c

    r7a9d968 r3f44e43  
    10721072                format = "%s\t%s\t%s";
    10731073        } else {
    1074                 format = "%-24.24s  %-40.40s  %s";
     1074                format = "%-16.16s  %-40.40s  %s";
    10751075        }
    10761076
     
    11721172}
    11731173
    1174 static void cmd_plugins_info(irc_t *irc, char **cmd)
    1175 {
    1176         GList *l;
    1177         struct plugin_info *info;
    1178 
    1179         MIN_ARGS(2);
    1180 
    1181         for (l = get_plugins(); l; l = l->next) {
    1182                 info = l->data;
    1183                 if (g_strcasecmp(cmd[2], info->name) == 0) {
    1184                         break;
    1185                 }
    1186         }
    1187 
    1188         if (!l) {
    1189                 return;
    1190         }
    1191 
    1192         irc_rootmsg(irc, "%s:", info->name);
    1193         irc_rootmsg(irc, "  Version: %s", info->version);
    1194 
    1195         if (info->description) {
    1196                 irc_rootmsg(irc, "  Description: %s", info->description);
    1197         }
    1198 
    1199         if (info->author) {
    1200                 irc_rootmsg(irc, "  Author: %s", info->author);
    1201         }
    1202 
    1203         if (info->url) {
    1204                 irc_rootmsg(irc, "  URL: %s", info->url);
    1205         }
    1206 }
    1207 
    12081174static void cmd_plugins(irc_t *irc, char **cmd)
    12091175{
    12101176        GList *prpls;
    12111177        GString *gstr;
    1212 
    1213         if (cmd[1] && g_strcasecmp(cmd[1], "info") == 0) {
    1214                 cmd_plugins_info(irc, cmd);
    1215                 return;
    1216         }
    12171178
    12181179#ifdef WITH_PLUGINS
    12191180        GList *l;
    12201181        struct plugin_info *info;
    1221         char *format;
    1222 
    1223         if (strchr(irc->umode, 'b') != NULL) {
    1224                 format = "%s\t%s";
    1225         } else {
    1226                 format = "%-30s  %s";
    1227         }
    1228 
    1229         irc_rootmsg(irc, format, "Plugin", "Version");
    12301182
    12311183        for (l = get_plugins(); l; l = l->next) {
    1232                 char *c;
    12331184                info = l->data;
    1234 
    1235                 /* some purple plugins like to include several versions separated by newlines... */
    1236                 if ((c = strchr(info->version, '\n'))) {
    1237                         char *version = g_strndup(info->version, c - info->version);
    1238                         irc_rootmsg(irc, format, info->name, version);
    1239                         g_free(version);
    1240                 } else {
    1241                         irc_rootmsg(irc, format, info->name, info->version);
    1242                 }
     1185                irc_rootmsg(irc, "%s:", info->name);
     1186                irc_rootmsg(irc, "  Version: %s", info->version);
     1187
     1188                if (info->description) {
     1189                        irc_rootmsg(irc, "  Description: %s", info->description);
     1190                }
     1191
     1192                if (info->author) {
     1193                        irc_rootmsg(irc, "  Author: %s", info->author);
     1194                }
     1195
     1196                if (info->url) {
     1197                        irc_rootmsg(irc, "  URL: %s", info->url);
     1198                }
     1199
     1200                irc_rootmsg(irc, "");
    12431201        }
    12441202#endif
    1245 
    1246         irc_rootmsg(irc, "");
    12471203
    12481204        gstr = g_string_new(NULL);
     
    13901346        } else if (g_strcasecmp(cmd[1], "set") == 0 ||
    13911347                   g_strcasecmp(cmd[1], "del") == 0) {
    1392                 irc_rootmsg(irc, "Unknown command: chat %s. Did you mean \002channel %s\002?", cmd[1], cmd[1]);
     1348                irc_rootmsg(irc,
     1349                            "Warning: The \002chat\002 command was mostly replaced with the \002channel\002 command.");
     1350                cmd_channel(irc, cmd);
    13931351        } else {
    13941352                irc_rootmsg(irc,
     
    14481406                topic = ci->topic ? ci->topic : "";
    14491407
    1450                 padded = str_pad_and_truncate(ci->title ? ci->title : "", title_len, "[...]");
     1408                padded = str_pad_and_truncate(ci->title, title_len, "[...]");
    14511409                irc_rootmsg(irc, iformat, ++i, padded, topic);
    14521410                g_free(padded);
  • set.c

    r7a9d968 r3f44e43  
    165165        /* If there's a default setting and it's equal to what we're trying to
    166166           set, stick with s->value = NULL. Otherwise, remember the setting. */
    167         if (!s->def || (g_strcmp0(nv, s->def) != 0)) {
     167        if (!s->def || (strcmp(nv, s->def) != 0)) {
    168168                s->value = g_strdup(nv);
    169169        }
  • storage.c

    r7a9d968 r3f44e43  
    7474
    7575        storage = storage_init_single(primary);
    76         if (storage == NULL || storage->save == NULL) {
     76        if (storage == NULL && storage->save == NULL) {
    7777                return NULL;
    7878        }
  • storage_xml.c

    r7a9d968 r3f44e43  
    290290        }
    291291
    292         handle_settings(node, &xd->irc->b->set);
    293 
    294292        if (xt_handle(xp, NULL, 1) == XT_HANDLED) {
    295293                ret = STORAGE_OK;
    296294        }
     295
     296        handle_settings(node, &xd->irc->b->set);
    297297
    298298error:
  • tests/Makefile

    r7a9d968 r3f44e43  
    2121check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o
    2222        @echo '*' Linking $@
    23         $(VERBOSE) $(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS)
     23        @$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS)
    2424
    2525%.o: $(_SRCDIR_)%.c
    2626        @echo '*' Compiling $<
    27         $(VERBOSE) $(CC) -c $(CFLAGS) $< -o $@
     27        @$(CC) -c $(CFLAGS) $< -o $@
  • tests/check.c

    r7a9d968 r3f44e43  
    1414        int sock[2];
    1515
    16         if (socketpair(AF_UNIX, SOCK_STREAM, 0, sock) < 0) {
     16        if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNIX, sock) < 0) {
    1717                perror("socketpair");
    1818                return FALSE;
  • tests/check_jabber_util.c

    r7a9d968 r3f44e43  
    3737        fail_unless(jabber_buddy_by_jid(ic, "wilmer@GAAST.NET/BitlBee", GET_BUDDY_CREAT) == budw1);
    3838
    39         fail_unless(jabber_buddy_by_jid(ic, "wilmer@gaast.net", GET_BUDDY_EXACT) != NULL);
     39        fail_unless(jabber_buddy_by_jid(ic, "wilmer@gaast.net", GET_BUDDY_EXACT));
    4040        fail_unless(jabber_buddy_by_jid(ic, "WILMER@gaast.net", 0) == budw3);
    4141
     
    8383        fail_if(jabber_buddy_remove(ic, "nekkid@lamejab.net/Illegal"));
    8484        fail_unless(jabber_buddy_remove(ic, "nekkid@lamejab.net"));
    85         fail_if(jabber_buddy_by_jid(ic, "nekkid@lamejab.net", 0) != NULL);
     85        fail_if(jabber_buddy_by_jid(ic, "nekkid@lamejab.net", 0));
    8686
    8787        /* Fixing a bug in this branch that caused information to get lost when
  • unix.c

    r7a9d968 r3f44e43  
    147147                struct passwd *pw = NULL;
    148148                pw = getpwnam(global.conf->user);
    149                 if (!pw) {
    150                         log_message(LOGLVL_ERROR, "Failed to look up user %s.", global.conf->user);
    151 
    152                 } else if (initgroups(global.conf->user, pw->pw_gid) != 0) {
    153                         log_message(LOGLVL_ERROR, "initgroups: %s.", strerror(errno));
    154 
    155                 } else if (setgid(pw->pw_gid) != 0) {
    156                         log_message(LOGLVL_ERROR, "setgid(%d): %s.", pw->pw_gid, strerror(errno));
    157 
    158                 } else if (setuid(pw->pw_uid) != 0) {
    159                         log_message(LOGLVL_ERROR, "setuid(%d): %s.", pw->pw_uid, strerror(errno));
     149                if (pw) {
     150                        initgroups(global.conf->user, pw->pw_gid);
     151                        setgid(pw->pw_gid);
     152                        setuid(pw->pw_uid);
     153                } else {
     154                        log_message(LOGLVL_WARNING, "Failed to look up user %s.", global.conf->user);
    160155                }
    161156        }
     
    286281static void sighandler_shutdown(int signal)
    287282{
    288         int unused G_GNUC_UNUSED;
    289283        /* Write a single null byte to the pipe, just to send a message to the main loop.
    290284         * This gets handled by bitlbee_shutdown (the b_input_add callback for this pipe) */
    291         unused = write(shutdown_pipe.fd[1], "", 1);
     285        write(shutdown_pipe.fd[1], "", 1);
    292286}
    293287
     
    298292{
    299293        GSList *l;
    300         int unused G_GNUC_UNUSED;
    301294        const char *message = "ERROR :BitlBee crashed! (SIGSEGV received)\r\n";
    302295        int len = strlen(message);
     
    305298                irc_t *irc = l->data;
    306299                sock_make_blocking(irc->fd);
    307                 unused = write(irc->fd, message, len);
     300                write(irc->fd, message, len);
    308301        }
    309302
Note: See TracChangeset for help on using the changeset viewer.