Changeset 85e9644


Ignore:
Timestamp:
2006-06-07T13:36:19Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
c121f89
Parents:
a312b6b (diff), 0025b51 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging Jelmer's storage tree (with LDAP support).

Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    ra312b6b r85e9644  
    1313headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ini.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h url.h user.h protocols/http_client.h protocols/md5.h protocols/nogaim.h protocols/proxy.h protocols/sha.h protocols/ssl_client.h
    1414subdirs = protocols
     15
     16objects += $(LDAP_OBJ)
    1517
    1618# Expansion of variables
  • configure

    ra312b6b r85e9644  
    3131
    3232events=glib
     33ldap=auto
    3334ssl=auto
    3435
     
    6667
    6768--ipv6=0/1      IPv6 socket support                     $ipv6
     69
     70--ldap=0/1/auto LDAP support                            $ldap
    6871
    6972--events=...    Event handler (glib, libevent)          $events
     
    146149
    147150if [ -n "$CC" ]; then
    148         echo "CC=$CC" >> Makefile.settings;
     151        CC=$CC
    149152elif type gcc > /dev/null 2> /dev/null; then
    150         echo "CC=gcc" >> Makefile.settings;
     153        CC=gcc
    151154elif type cc > /dev/null 2> /dev/null; then
    152         echo "CC=cc" >> Makefile.settings;
     155        CC=cc
    153156else
    154157        echo 'Cannot find a C compiler, aborting.'
    155158        exit 1;
    156159fi
     160
     161echo "CC=$CC" >> Makefile.settings;
    157162
    158163if [ -n "$LD" ]; then
     
    230235                ret=0;
    231236        fi;
     237}
     238
     239detect_ldap()
     240{
     241        TMPFILE=`mktemp`
     242        if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
     243                cat<<EOF>>Makefile.settings
     244EFLAGS+=-lldap
     245CFLAGS+=
     246EOF
     247                ldap=1
     248                rm -f $TMPFILE
     249                ret=1
     250        else
     251                ldap=0
     252                ret=0
     253        fi
    232254}
    233255
     
    292314fi
    293315
     316if [ "$ldap" = "auto" ]; then
     317        detect_ldap
     318fi
     319
     320if [ "$ldap" = 0 ]; then
     321        echo "LDAP_OBJ=\# no ldap" >> Makefile.settings
     322        echo "#undef WITH_LDAP" >> config.h
     323elif [ "$ldap" = 1 ]; then
     324        echo "#define WITH_LDAP 1" >> config.h
     325        echo "LDAP_OBJ=storage_ldap.o" >> Makefile.settings
     326fi
     327
    294328if [ "$strip" = 0 ]; then
    295329        echo "STRIP=\# skip strip" >> Makefile.settings;
     
    444478        echo '  Building without IM-protocol support. We wish you a lot of fun...';
    445479fi
     480
     481if [ "$ldap" = "0" ]; then
     482        echo "  LDAP storage backend disabled."
     483else
     484        echo "  LDAP storage backend enabled."
     485fi
  • irc.c

    ra312b6b r85e9644  
    905905void irc_kill( irc_t *irc, user_t *u )
    906906{
    907         char *nick;
    908        
    909         irc_write( irc, ":%s!%s@%s QUIT :%s", u->nick, u->user, u->host, "Leaving..." );
     907        char *nick, *s;
     908        char reason[64];
     909       
     910        if( u->gc && u->gc->flags & OPT_LOGGING_OUT )
     911        {
     912                if( u->gc->user->proto_opt[0][0] )
     913                        g_snprintf( reason, sizeof( reason ), "%s %s", irc->myhost,
     914                                    u->gc->user->proto_opt[0] );
     915                else if( ( s = strchr( u->gc->username, '@' ) ) )
     916                        g_snprintf( reason, sizeof( reason ), "%s %s", irc->myhost,
     917                                    s + 1 );
     918                else
     919                        g_snprintf( reason, sizeof( reason ), "%s %s.%s", irc->myhost,
     920                                    u->gc->prpl->name, irc->myhost );
     921               
     922                /* proto_opt might contain garbage after the : */
     923                if( ( s = strchr( reason, ':' ) ) )
     924                        *s = 0;
     925        }
     926        else
     927        {
     928                strcpy( reason, "Leaving..." );
     929        }
     930       
     931        irc_write( irc, ":%s!%s@%s QUIT :%s", u->nick, u->user, u->host, reason );
    910932       
    911933        nick = g_strdup( u->nick );
  • protocols/nogaim.c

    ra312b6b r85e9644  
    294294       
    295295        serv_got_crap( gc, "Signing off.." );
    296 
     296        gc->flags |= OPT_LOGGING_OUT;
     297       
    297298        b_event_remove( gc->keepalive );
    298299        gc->keepalive = 0;
  • protocols/nogaim.h

    ra312b6b r85e9644  
    5454#define WEBSITE "http://www.bitlbee.org/"
    5555#define IM_FLAG_AWAY 0x0020
    56 #define OPT_CONN_HTML 0x00000001
    57 #define OPT_LOGGED_IN 0x00010000
    5856#define GAIM_AWAY_CUSTOM "Custom"
     57
     58#define OPT_CONN_HTML   0x00000001
     59#define OPT_LOGGED_IN   0x00010000
     60#define OPT_LOGGING_OUT 0x00020000
    5961
    6062/* ok. now the fun begins. first we create a connection structure */
  • storage.c

    ra312b6b r85e9644  
    66
    77/* Support for multiple storage backends */
     8
     9/* Copyright (C) 2005 Jelmer Vernooij <jelmer@samba.org> */
    810
    911/*
Note: See TracChangeset for help on using the changeset viewer.