Changeset 4022b68
- Timestamp:
- 2010-08-21T22:42:01Z (14 years ago)
- Branches:
- master
- Children:
- fd424c8
- Parents:
- 327af51 (diff), c00dd71 (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. - Files:
-
- 1 added
- 18 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
debian/bitlbee-common.postinst
r327af51 r4022b68 64 64 fi 65 65 66 if [ -n "$2" -a "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then 67 if which invoke-rc.d >/dev/null 2>&1; then 66 # The official way to check if we're upgrading is to check if $2 is 67 # non-empty. However, previous versions of BitlBee didn't have a 68 # bitlbee-common package so in that case the var will also be empty. 69 # Instead, check if the port is in use (if netstat is available). This 70 # works since the debconf code will pick a free port on new installs. 71 if [ "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then 72 unset IS_UPGRADE 73 if type netstat > /dev/null 2> /dev/null; then 74 netstat -an | grep -q :$PORT\\b.*LISTEN && IS_UPGRADE=1 75 else 76 [ -n "$2" ] && IS_UPGRADE=1 77 fi 78 if [ -n "$IS_UPGRADE" ]; then 68 79 invoke-rc.d bitlbee restart 69 else70 /etc/init.d/bitlbee restart71 80 fi 72 81 fi … … 95 104 96 105 if [ -z "$2" ]; then 97 if which invoke-rc.d >/dev/null 2>&1; then 98 invoke-rc.d bitlbee start 99 else 100 /etc/init.d/bitlbee start 101 fi 106 invoke-rc.d bitlbee start 102 107 fi -
debian/bitlbee.prerm
r327af51 r4022b68 1 1 #!/bin/sh -e 2 2 3 if [ "$1" = "upgrade" ]; then 4 ## To prevent the help function from breaking in currently running 5 ## BitlBee processes. Have to do it like this because dpkg-reconfigure 6 ## looks a lot like an upgrade and we don't want to lose help.txt... 7 if [ -e /usr/share/bitlbee/help.txt ]; then 8 rm -f /usr/share/bitlbee/help.upgrading 9 mv /usr/share/bitlbee/help.txt /usr/share/bitlbee/help.upgrading 10 fi 11 else 12 if which invoke-rc.d >/dev/null 2>&1; then 13 invoke-rc.d bitlbee stop || exit 0 14 else 15 /etc/init.d/bitlbee stop || exit 0 16 fi 3 if [ "$1" != "upgrade" ]; then 4 invoke-rc.d bitlbee stop || exit 0 17 5 fi -
debian/changelog
r327af51 r4022b68 6 6 bitlbee-common. 7 7 8 -- Wilmer van der Gaast <wilmer@gaast.net> Sat, 05 Jun 2010 15:16:38+01008 -- Wilmer van der Gaast <wilmer@gaast.net> Wed, 18 Aug 2010 00:53:11 +0100 9 9 10 10 bitlbee (1.2.8-1) unstable; urgency=low -
debian/rules
r327af51 r4022b68 8 8 # 9 9 10 # Include the bitlbee-libpurple variant by default 11 BITLBEE_LIBPURPLE ?= 1 10 12 BITLBEE_CONFIGURE_FLAGS ?= 11 13 DEBUG ?= 0 … … 14 16 # Want to use the full package version number instead of just the release. 15 17 BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\" 18 endif 19 20 ifneq ($(BITLBEE_LIBPURPLE),1) 21 DH_OPTIONS += -Nbitlbee-libpurple 16 22 endif 17 23 … … 24 30 $(MAKE) -C debian/build-native 25 31 32 ifeq ($(BITLBEE_LIBPURPLE),1) 26 33 mkdir -p debian/build-libpurple 27 34 ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) 28 35 $(MAKE) -C debian/build-libpurple 36 endif 29 37 30 38 $(MAKE) -C doc … … 37 45 rm -f build-stamp 38 46 39 rm -rf build-arch-stamp debian/build-* 47 rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm 40 48 $(MAKE) distclean 41 49 … … 48 56 dh_installdirs 49 57 50 $(MAKE) -C debian/build-native install install-etcDESTDIR=`pwd`/debian/bitlbee51 $(MAKE) -C debian/build- libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple58 $(MAKE) -C debian/build-native install DESTDIR=`pwd`/debian/bitlbee 59 $(MAKE) -C debian/build-native install-etc DESTDIR=`pwd`/debian/bitlbee-common 52 60 $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev 61 patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff 53 62 54 patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff 55 patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff 63 ifeq ($(BITLBEE_LIBPURPLE),1) 64 $(MAKE) -C debian/build-libpurple install DESTDIR=`pwd`/debian/bitlbee-libpurple 65 ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm 66 endif 56 67 57 68 mkdir -p debian/bitlbee-common/usr … … 68 79 # TODO: Restore --link-doc up here and remove the hack below once 69 80 # Hardy and Lenny are deprecated. 70 for p in bitlbee bitlbee-libpurple bitlbee-dev; do rm -r f debian/$$p/usr/share/doc/$$p;ln -s bitlbee-common debian/$$p/usr/share/doc/$$p; done81 for p in bitlbee bitlbee-libpurple bitlbee-dev; do rm -r debian/$$p/usr/share/doc/$$p && ln -s bitlbee-common debian/$$p/usr/share/doc/$$p; done 71 82 dh_installdebconf 72 dh_installinit 73 ifeq ($(DH_OPTIONS),-a) 74 cp -a debian/bitlbee/etc debian/bitlbee-libpurple 75 endif 83 dh_installinit --init-script=bitlbee 76 84 dh_installman 77 85 dh_strip … … 80 88 dh_fixperms 81 89 dh_installdeb 82 ifeq ($(DH_OPTIONS),-a)83 cp -a debian/bitlbee/DEBIAN/post* debian/bitlbee/DEBIAN/pre* debian/bitlbee-libpurple/DEBIAN84 endif85 90 dh_shlibdeps 86 91 ifdef BITLBEE_VERSION … … 93 98 94 99 binary-indep: build install 95 $(MAKE) -f debian/rules DH_OPTIONS=-ibinary-common100 DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common 96 101 97 102 binary-arch: build install 98 $(MAKE) -f debian/rules DH_OPTIONS=-abinary-common103 DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common 99 104 100 105 binary-%: build install 101 make -f debian/rules binary-common DH_OPTIONS=-p$*106 DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common 102 107 103 108 binary: binary-indep binary-arch -
doc/user-guide/commands.xml
r327af51 r4022b68 829 829 </bitlbee-setting> 830 830 831 <bitlbee-setting name="mobile_is_away" type="boolean" scope="global"> 832 <default>false</default> 833 834 <description> 835 <para> 836 Most IM networks have a mobile version of their client. People who use these may not be paying that much attention to messages coming in. By enabling this setting, people using mobile clients will always be shown as away. 837 </para> 838 </description> 839 840 </bitlbee-setting> 841 831 842 <bitlbee-setting name="nick" type="string" scope="chat"> 832 843 <description> -
doc/user-guide/misc.xml
r327af51 r4022b68 234 234 </sect1> 235 235 236 <sect1 id="news1.3"> 237 <title>New stuff in BitlBee 1.3dev</title> 238 239 <para> 240 Most of the core of BitlBee was rewritten since the last release. This entry 241 should sum up the majority of the changes. 242 </para> 243 244 <para> 245 First of all, you can now have as many control channels as you want. Or you 246 can have none, it's finally possible to leave &bitlbee and still talk to 247 all your contacts. Or you can have a &work with all your work-related 248 contacts, or a &msn with all your MSN Messenger contacts. See <emphasis>help 249 channels</emphasis> for more information about this. 250 </para> 251 252 <para> 253 Also, you can change how nicknames are generated for your contacts. Like 254 automatically adding a [fb] tag to the nicks of all your Facebook contacts. 255 See <emphasis>help nick_format</emphasis>. 256 </para> 257 258 <para> 259 When you're already connected to a BitlBee server and you connect from 260 elsewhere, you can take over the old session. 261 </para> 262 263 <para> 264 Instead of account numbers, accounts now also get tags. These are 265 automatically generated but can be changed (<emphasis>help set 266 tag</emphasis>). You can now use them instead of accounts numbers. 267 (Example: <emphasis>acc gtalk on</emphasis>) 268 </para> 269 270 <para> 271 Last of all: You can finally change your nickname and 272 shorten root commands (try <emphasis>acc li</emphasis> instead 273 of <emphasis>account list</emphasis>). 274 </para> 275 276 </sect1> 277 236 278 </chapter> -
irc.c
r327af51 r4022b68 103 103 s = set_add( &b->set, "allow_takeover", "true", set_eval_bool, irc ); 104 104 s = set_add( &b->set, "away_devoice", "true", set_eval_bw_compat, irc ); 105 s->flags |= SET_HIDDEN; 105 106 s = set_add( &b->set, "away_reply_timeout", "3600", set_eval_int, irc ); 106 107 s = set_add( &b->set, "charset", "utf-8", set_eval_charset, irc ); … … 109 110 s = set_add( &b->set, "display_timestamps", "true", set_eval_bool, irc ); 110 111 s = set_add( &b->set, "handle_unknown", "add_channel", NULL, irc ); 112 s = set_add( &b->set, "last_version", NULL, NULL, irc ); 113 s->flags |= SET_HIDDEN; 111 114 s = set_add( &b->set, "lcnicks", "true", set_eval_bool, irc ); 112 115 s = set_add( &b->set, "nick_format", "%-@nick", NULL, irc ); … … 122 125 s = set_add( &b->set, "query_order", "lifo", NULL, irc ); 123 126 s = set_add( &b->set, "root_nick", ROOT_NICK, set_eval_root_nick, irc ); 127 s->flags |= SET_HIDDEN; 124 128 s = set_add( &b->set, "show_offline", "false", set_eval_bw_compat, irc ); 129 s->flags |= SET_HIDDEN; 125 130 s = set_add( &b->set, "simulate_netsplit", "true", set_eval_bool, irc ); 126 131 s = set_add( &b->set, "timezone", "local", set_eval_timezone, irc ); … … 915 920 val = "online@,away+,offline"; 916 921 else 917 return SET_INVALID;922 val = "online+,away"; 918 923 919 924 for( l = irc->channels; l; l = l->next ) -
irc_channel.c
r327af51 r4022b68 759 759 set_del( &ic->set, "group" ); 760 760 set_del( &ic->set, "protocol" ); 761 set_del( &ic->set, "show_users" ); 761 762 762 763 g_free( icc ); -
irc_send.c
r327af51 r4022b68 327 327 { 328 328 irc_write( iu->irc, ":%s!%s@%s %s %s :%s", 329 iu->nick, iu->user, iu->host, type, dst, msg );329 iu->nick, iu->user, iu->host, type, dst, msg && *msg ? msg : " " ); 330 330 } 331 331 -
lib/proxy.c
r327af51 r4022b68 49 49 char proxypass[128] = ""; 50 50 51 /* Some systems don't know this one. It's not essential, so set it to 0 then. */ 52 #ifndef AI_NUMERICSERV 53 #define AI_NUMERICSERV 0 54 #endif 55 51 56 struct PHB { 52 57 b_event_handler func, proxy_func; … … 56 61 int fd; 57 62 gint inpa; 63 struct addrinfo *gai, *gai_cur; 58 64 }; 65 66 static int proxy_connect_none(const char *host, unsigned short port_, struct PHB *phb); 59 67 60 68 static gboolean gaim_io_connected(gpointer data, gint source, b_input_condition cond) … … 66 74 67 75 #ifndef _WIN32 68 if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { 76 if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0 || error) { 77 if ((phb->gai_cur = phb->gai_cur->ai_next)) { 78 int new_fd; 79 b_event_remove(phb->inpa); 80 if ((new_fd = proxy_connect_none(NULL, 0, phb))) { 81 b_event_remove(phb->inpa); 82 closesocket(source); 83 dup2(new_fd, source); 84 phb->inpa = b_input_add(source, B_EV_IO_WRITE, gaim_io_connected, phb); 85 return FALSE; 86 } 87 } 88 freeaddrinfo(phb->gai); 69 89 closesocket(source); 70 90 b_event_remove(phb->inpa); … … 78 98 } 79 99 #endif 100 freeaddrinfo(phb->gai); 80 101 sock_make_blocking(source); 81 102 b_event_remove(phb->inpa); … … 94 115 struct sockaddr_in me; 95 116 int fd = -1; 96 int ret; 97 char port[6]; 98 struct addrinfo hints; 99 struct addrinfo* result; 100 101 g_snprintf(port, sizeof(port), "%d", port_); 102 103 memset(&hints, 0, sizeof(struct addrinfo)); 104 hints.ai_family = AF_UNSPEC; 105 hints.ai_socktype = SOCK_STREAM; 106 hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV; 107 108 if (!(ret = getaddrinfo(host, port, &hints, &result))) 117 118 if (phb->gai_cur == NULL) 109 119 { 110 struct addrinfo* rp; 111 112 for (rp = result; rp; rp = rp->ai_next) 120 int ret; 121 char port[6]; 122 struct addrinfo hints; 123 124 g_snprintf(port, sizeof(port), "%d", port_); 125 126 memset(&hints, 0, sizeof(struct addrinfo)); 127 hints.ai_family = AF_UNSPEC; 128 hints.ai_socktype = SOCK_STREAM; 129 hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV; 130 131 if (!(ret = getaddrinfo(host, port, &hints, &phb->gai))) 132 phb->gai_cur = phb->gai; 133 else 134 event_debug("gai(): %s\n", gai_strerror(ret)); 135 } 136 137 for (; phb->gai_cur; phb->gai_cur = phb->gai_cur->ai_next) 138 { 139 if ((fd = socket(phb->gai_cur->ai_family, phb->gai_cur->ai_socktype, phb->gai_cur->ai_protocol)) < 0) { 140 event_debug( "socket failed: %d\n", errno); 141 continue; 142 } 143 144 sock_make_nonblocking(fd); 145 146 if (global.conf->iface_out) 113 147 { 114 if ((fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) < 0) { 115 event_debug( "socket failed: %d\n", errno); 116 continue; 117 } 118 119 sock_make_nonblocking(fd); 120 121 if (global.conf->iface_out) 122 { 123 me.sin_family = AF_INET; 124 me.sin_port = 0; 125 me.sin_addr.s_addr = inet_addr( global.conf->iface_out ); 148 me.sin_family = AF_INET; 149 me.sin_port = 0; 150 me.sin_addr.s_addr = inet_addr( global.conf->iface_out ); 126 151 127 if (bind(fd, (struct sockaddr *) &me, sizeof(me)) != 0) 128 event_debug("bind( %d, \"%s\" ) failure\n", fd, global.conf->iface_out); 129 } 130 131 event_debug("proxy_connect_none( \"%s\", %d ) = %d\n", host, port, fd); 132 133 if (connect(fd, rp->ai_addr, rp->ai_addrlen) < 0 && !sockerr_again()) { 134 event_debug( "connect failed: %s\n", strerror(errno)); 135 closesocket(fd); 136 fd = -1; 137 continue; 138 } else { 139 phb->inpa = b_input_add(fd, B_EV_IO_WRITE, gaim_io_connected, phb); 140 phb->fd = fd; 141 142 break; 143 } 144 } 145 146 freeaddrinfo(result); 147 } 148 else 149 { 150 event_debug("gai(): %s\n", gai_strerror(ret)); 151 } 152 153 if(fd < 0) 152 if (bind(fd, (struct sockaddr *) &me, sizeof(me)) != 0) 153 event_debug("bind( %d, \"%s\" ) failure\n", fd, global.conf->iface_out); 154 } 155 156 event_debug("proxy_connect_none( \"%s\", %d ) = %d\n", host, port, fd); 157 158 if (connect(fd, phb->gai_cur->ai_addr, phb->gai_cur->ai_addrlen) < 0 && !sockerr_again()) { 159 event_debug( "connect failed: %s\n", strerror(errno)); 160 closesocket(fd); 161 fd = -1; 162 continue; 163 } else { 164 phb->inpa = b_input_add(fd, B_EV_IO_WRITE, gaim_io_connected, phb); 165 phb->fd = fd; 166 167 break; 168 } 169 } 170 171 if(fd < 0 && host) 154 172 g_free(phb); 155 173 -
protocols/bee.c
r327af51 r4022b68 40 40 s = set_add( &b->set, "auto_reconnect_delay", "5*3<900", set_eval_account_reconnect_delay, b ); 41 41 s = set_add( &b->set, "debug", "false", set_eval_bool, b ); 42 s = set_add( &b->set, "mobile_is_away", "false", set_eval_bool, b ); 42 43 s = set_add( &b->set, "save_on_quit", "true", set_eval_bool, b ); 43 44 s = set_add( &b->set, "status", NULL, set_eval_away_status, b ); -
protocols/bee.h
r327af51 r4022b68 56 56 void bee_free( bee_t *b ); 57 57 58 /* TODO(wilmer): Kill at least the OPT_ flags that have an equivalent here. */ 58 59 typedef enum 59 60 { 60 61 BEE_USER_ONLINE = 1, /* Compatibility with old OPT_LOGGED_IN flag */ 61 62 BEE_USER_AWAY = 4, /* Compatibility with old OPT_AWAY flag */ 63 BEE_USER_MOBILE = 8, /* Compatibility with old OPT_MOBILE flag */ 62 64 BEE_USER_LOCAL = 256, /* Locally-added contacts (not in real contact list) */ 63 65 } bee_user_flags_t; -
protocols/bee_user.c
r327af51 r4022b68 195 195 bu->status = NULL; 196 196 197 if( bu->status == NULL && ( flags & OPT_MOBILE ) && 198 set_getbool( &bee->set, "mobile_is_away" ) ) 199 { 200 bu->flags |= BEE_USER_AWAY; 201 bu->status = g_strdup( "Mobile" ); 202 } 203 197 204 if( bee->ui->user_status ) 198 205 bee->ui->user_status( bee, bu, old ); … … 268 275 } 269 276 270 void imcb_buddy_typing( struct im_connection *ic, c har *handle, uint32_t flags )277 void imcb_buddy_typing( struct im_connection *ic, const char *handle, uint32_t flags ) 271 278 { 272 279 bee_user_t *bu; -
protocols/nogaim.h
r327af51 r4022b68 63 63 #define OPT_LOGGING_OUT 0x00000002 64 64 #define OPT_AWAY 0x00000004 65 #define OPT_MOBILE 0x00000008 65 66 #define OPT_DOES_HTML 0x00000010 66 67 #define OPT_LOCALBUDDY 0x00000020 /* For nicks local to one groupchat */ … … 312 313 G_MODULE_EXPORT void imcb_buddy_nick_hint( struct im_connection *ic, const char *handle, const char *nick ); 313 314 314 G_MODULE_EXPORT void imcb_buddy_typing( struct im_connection *ic, c har *handle, uint32_t flags );315 G_MODULE_EXPORT void imcb_buddy_typing( struct im_connection *ic, const char *handle, uint32_t flags ); 315 316 G_MODULE_EXPORT struct bee_user *imcb_buddy_by_handle( struct im_connection *ic, const char *handle ); 316 317 G_MODULE_EXPORT void imcb_clean_handle( struct im_connection *ic, char *handle ); -
protocols/oscar/oscar.c
r327af51 r4022b68 898 898 flags |= OPT_AWAY; 899 899 } 900 901 /* Maybe this should be done just for AIM contacts, not sure. */ 902 if (info->flags & AIM_FLAG_WIRELESS) 903 flags |= OPT_MOBILE; 900 904 901 905 if (info->present & AIM_USERINFO_PRESENT_ICQEXTSTATUS) { -
protocols/purple/purple.c
r327af51 r4022b68 427 427 { 428 428 PurpleTypingState state = PURPLE_NOT_TYPING; 429 Purple Conversation *conv;429 PurpleAccount *pa = ic->proto_data; 430 430 431 431 if( flags & OPT_TYPING ) … … 434 434 state = PURPLE_TYPED; 435 435 436 if( ( conv = purple_find_conversation_with_account( PURPLE_CONV_TYPE_IM, 437 who, ic->proto_data ) ) == NULL ) 438 { 439 purple_conv_im_set_typing_state( purple_conversation_get_im_data( conv ), state ); 440 return 1; 441 } 442 else 443 { 444 return 0; 445 } 436 serv_send_typing( purple_account_get_connection( pa ), who, state ); 437 438 return 1; 446 439 } 447 440 … … 807 800 808 801 imcb_buddy_msg( ic, (char*) who, (char*) message, 0, mtime ); 802 } 803 804 /* No, this is not a ui_op but a signal. */ 805 static void prplcb_buddy_typing( PurpleAccount *account, const char *who, gpointer null ) 806 { 807 PurpleConversation *conv; 808 PurpleConvIm *im; 809 int state; 810 811 if( ( conv = purple_find_conversation_with_account( PURPLE_CONV_TYPE_IM, who, account ) ) == NULL ) 812 return; 813 814 im = PURPLE_CONV_IM(conv); 815 switch( purple_conv_im_get_typing_state( im ) ) 816 { 817 case PURPLE_TYPING: 818 state = OPT_TYPING; 819 break; 820 case PURPLE_TYPED: 821 state = OPT_THINKING; 822 break; 823 default: 824 state = 0; 825 } 826 827 imcb_buddy_typing( purple_ic_by_pa( account ), who, state ); 809 828 } 810 829 … … 1139 1158 purple_prefs_load(); 1140 1159 1160 /* No, really. So far there were ui_ops for everything, but now suddenly 1161 one needs to use signals for typing notification stuff. :-( */ 1162 purple_signal_connect( purple_conversations_get_handle(), "buddy-typing", 1163 &funcs, PURPLE_CALLBACK(prplcb_buddy_typing), NULL ); 1164 purple_signal_connect( purple_conversations_get_handle(), "buddy-typed", 1165 &funcs, PURPLE_CALLBACK(prplcb_buddy_typing), NULL ); 1166 purple_signal_connect( purple_conversations_get_handle(), "buddy-typing-stopped", 1167 &funcs, PURPLE_CALLBACK(prplcb_buddy_typing), NULL ); 1168 1141 1169 memset( &funcs, 0, sizeof( funcs ) ); 1142 1170 funcs.login = purple_login; -
protocols/yahoo/yahoo.c
r327af51 r4022b68 589 589 if( away ) 590 590 flags |= OPT_AWAY; 591 if( mobile ) 592 flags |= OPT_MOBILE; 591 593 592 594 switch (stat) -
root_commands.c
r327af51 r4022b68 100 100 101 101 static void cmd_account( irc_t *irc, char **cmd ); 102 static void bitlbee_whatsnew( irc_t *irc ); 102 103 103 104 static void cmd_identify( irc_t *irc, char **cmd ) … … 155 156 irc->status |= USTATUS_IDENTIFIED; 156 157 irc_umode_set( irc, "+R", 1 ); 158 159 bitlbee_whatsnew( irc ); 157 160 158 161 /* The following code is a bit hairy now. With takeover … … 267 270 if( ( val = set_getstr( head, key ) ) ) 268 271 irc_usermsg( irc, "%s = `%s'", key, val ); 272 else if( !set_find( head, key ) ) 273 { 274 irc_usermsg( irc, "Setting `%s' does not exist.", key ); 275 if( *head == irc->b->set ) 276 irc_usermsg( irc, "It might be an account or channel setting. " 277 "See \x02help account set\x02 and \x02help channel set\x02." ); 278 } 269 279 else 270 280 irc_usermsg( irc, "%s is empty", key ); … … 304 314 st = set_setstr( head, set_name, value ); 305 315 306 if( set_getstr( head, set_name ) == NULL ) 316 if( set_getstr( head, set_name ) == NULL && 317 set_find( head, set_name ) ) 307 318 { 308 319 /* This happens when changing the passwd, for example. … … 328 339 while( s ) 329 340 { 330 cmd_showset( irc, &s, s->key ); 341 if( !( s->flags & SET_HIDDEN ) ) 342 cmd_showset( irc, &s, s->key ); 331 343 s = s->next; 332 344 } … … 1008 1020 irc_usermsg( irc, format, "Nick", "Handle/Account", "Status" ); 1009 1021 1010 if( strcmp( set_getstr( &irc->root->last_channel->set, "type" ), "control" ) != 0 ) 1022 if( irc->root->last_channel && 1023 strcmp( set_getstr( &irc->root->last_channel->set, "type" ), "control" ) != 0 ) 1011 1024 irc->root->last_channel = NULL; 1012 1025 … … 1271 1284 } 1272 1285 1286 /* Maybe this should be a stand-alone command as well? */ 1287 static void bitlbee_whatsnew( irc_t *irc ) 1288 { 1289 int last = set_getint( &irc->b->set, "last_version" ); 1290 GString *msg = g_string_new( "" ); 1291 char s[16]; 1292 1293 if( last >= BITLBEE_VERSION_CODE ) 1294 return; 1295 1296 if( last < 0x010206 ) /* 1.2.6 */ 1297 { 1298 g_string_append( msg, 1299 "Twitter support. See \x02help account add twitter\x02.\n" ); 1300 } 1301 if( last < 0x010300 ) /* 1.3dev */ 1302 { 1303 g_string_append( msg, 1304 "Support for multiple configurable control channels, " 1305 "each with a subset of your contact list. See " 1306 "\x02help channels\x02 for more information.\n" 1307 "File transfer support for some protocols (more if " 1308 "you use libpurple). Just /DCC SEND stuff. Incoming " 1309 "files also become DCC transfers.\n" 1310 "Many more things, briefly described in " 1311 "\x02help news1.3\x02.\n" ); 1312 } 1313 1314 if( msg->len > 0 ) 1315 irc_usermsg( irc, "%s: This seems to be your first time using this " 1316 "this version of BitlBee. Here's a list of new " 1317 "features you may like to know about:\n\n%s\n", 1318 irc->user->nick, msg->str ); 1319 1320 g_string_free( msg, TRUE ); 1321 g_snprintf( s, sizeof( s ), "%d", BITLBEE_VERSION_CODE ); 1322 set_setstr( &irc->b->set, "last_version", s ); 1323 } 1324 1273 1325 /* IMPORTANT: Keep this list sorted! The short command logic needs that. */ 1274 1326 const command_t commands[] = { -
set.h
r327af51 r4022b68 43 43 extern char *SET_INVALID; 44 44 45 #define SET_NULL_OK 0x0100 45 typedef enum 46 { 47 SET_NULL_OK = 0x0100, 48 SET_HIDDEN = 0x0200, 49 } set_flags_t; 46 50 47 51 typedef struct set … … 60 64 set_getstr/int(). */ 61 65 62 int flags; /* See account.h, for example. set.c doesn't use 63 this (yet?). */ 66 set_flags_t flags; /* Mostly defined per user. */ 64 67 65 68 /* Eval: Returns SET_INVALID if the value is incorrect, exactly
Note: See TracChangeset
for help on using the changeset viewer.