diff options
-rwxr-xr-x | configure | 25 | ||||
-rw-r--r-- | protocols/nogaim.c | 15 |
2 files changed, 29 insertions, 11 deletions
@@ -449,6 +449,22 @@ EOF protocols='' protoobjs='' +if [ "$purple" = 0 ]; then + echo '#undef WITH_PURPLE' >> config.h +else + echo '#define WITH_PURPLE' >> config.h + echo 'EFLAGS += $$(pkg-config purple --libs)' >> Makefile.settings + protocols=$protocols'purple ' + protoobjs=$protoobjs'purple_mod.o ' + + # Having both libpurple and native IM modules in one binary may + # do strange things. Let's not do that. + msn=0 + jabber=0 + oscar=0 + yahoo=0 +fi + if [ "$msn" = 0 ]; then echo '#undef WITH_MSN' >> config.h else @@ -481,15 +497,6 @@ else protoobjs=$protoobjs'yahoo_mod.o ' fi -if [ "$purple" = 0 ]; then - echo '#undef WITH_PURPLE' >> config.h -else - echo '#define WITH_PURPLE' >> config.h - echo 'EFLAGS += $$(pkg-config purple --libs)' >> Makefile.settings - protocols=$protocols'purple ' - protoobjs=$protoobjs'purple_mod.o ' -fi - if [ "$protocols" = "PROTOCOLS = " ]; then echo "Warning: You haven't selected any communication protocol to compile!" echo " BitlBee will run, but you will be unable to connect to IM servers!" diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 8eae178d..7e8782ac 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -101,12 +101,23 @@ void register_protocol (struct prpl *p) struct prpl *find_protocol(const char *name) { GList *gl; - for (gl = protocols; gl; gl = gl->next) + + for( gl = protocols; gl; gl = gl->next ) { struct prpl *proto = gl->data; - if(!g_strcasecmp(proto->name, name)) + + if( g_strcasecmp( proto->name, name ) == 0 ) return proto; + +#ifdef WITH_PURPLE + /* I know, hardcoding is evil, but that doesn't make it + impossible. :-) */ + if( g_strncasecmp( proto->name, "prpl-", 5 ) == 0 && + g_strcasecmp( proto->name + 5, name ) == 0 ) + return proto; +#endif } + return NULL; } |