Changes in / [cfcc587:cf13671]
- Files:
-
- 2 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
rcfcc587 rcf13671 24 24 25 25 all: $(OUTFILE) 26 $(MAKE) -C doc27 26 28 27 uninstall: uninstall-bin uninstall-doc … … 48 47 distclean: clean $(subdirs) 49 48 rm -f Makefile.settings config.h 50 find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;49 find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' | xargs rm -f 51 50 52 51 install-doc: -
bitlbee.h
rcfcc587 rcf13671 30 30 31 31 #define PACKAGE "BitlBee" 32 #define BITLBEE_VERSION " 1.0pre"32 #define BITLBEE_VERSION "0.99" 33 33 #define VERSION BITLBEE_VERSION 34 34 … … 87 87 88 88 #define DEFAULT_AWAY "Away from computer" 89 #define CONTROL_TOPIC "Welcome to the control channel. Type \2help\2for help information."89 #define CONTROL_TOPIC "Welcome to the control channel. Type help for help information." 90 90 #define IRCD_INFO "BitlBee <http://www.bitlbee.org/>" 91 91 -
crypting.c
rcfcc587 rcf13671 55 55 #include <stdlib.h> 56 56 57 #define irc_usermsg58 59 57 #endif 60 58 -
doc/CHANGES
rcfcc587 rcf13671 8 8 - HTML stripping is configurable again. 9 9 - Quit messages (at least on crashes) should appear again. 10 - Cleaned up some unnecessary code in the Jabber module, and implemented11 handlers for headline messages (which allows you to use RSS-to-Jabber12 gateways).13 10 14 11 Finished ... -
doc/Makefile
rcfcc587 rcf13671 1 1 -include ../Makefile.settings 2 3 all:4 # Only build the docs if this is a bzr checkout5 test ! -d ../.bzr || $(MAKE) -C user-guide6 2 7 3 install: -
doc/bitlbee.8
rcfcc587 rcf13671 39 39 networks and acts as a gateway. Users can connect to the server 40 40 with any normal IRC client and see their 'buddy list' in 41 &bitlbee. BitlBee's protocol support is based on the gaim41 #bitlbee. BitlBee's protocol support is based on the gaim 42 42 protocol plugins. BitlBee currently supports Oscar (aim and icq), 43 43 MSN, Jabber and Yahoo. … … 86 86 .SH COMMANDS 87 87 To get a complete list of commands, please use the \fBhelp commands\fP 88 command in the &bitlbee channel.88 command in the #bitlbee channel. 89 89 .SH "SEE ALSO" 90 90 .BR ircd (8), -
doc/user-guide/Usage.xml
rcfcc587 rcf13671 14 14 15 15 <sect1> 16 <title>The &bitlbee control channel</title>16 <title>The #bitlbee control channel</title> 17 17 18 18 <para> 19 19 Once you are connected to the BitlBee server, you are automatically joined 20 to &bitlbee on that server. This channel acts like the 'buddy list' you have20 to #bitlbee on that server. This channel acts like the 'buddy list' you have 21 21 on the various other chat networks. 22 22 </para> 23 23 24 24 <para> 25 The user 'root' always hangs around in &bitlbee and acts as your interface 26 to bitlbee. All commands you give on &bitlbee are 'answered' by root. 27 </para> 28 29 <para> 30 You might be slightly confused by the & in the channel name. This is, 31 however, completely allowed by the IRC standards. Just try it on a regular 32 IRC server, it should work. The difference between the standard #channels 33 and &channels is that the #channels are distributed over all the servers 34 on the IRC network, while &channels are local to one server. Because 35 the BitlBee control channel is local to one server (and in fact, to one person), 36 this name seems more suitable. Also, with this name, it's harder to confuse 37 the control channel with the #bitlbee channel on OFTC. 25 The user 'root' always hangs around in #bitlbee and acts as your interface 26 to bitlbee. All commands you give on #bitlbee are 'answered' by root. 38 27 </para> 39 28 -
doc/user-guide/commands.xml
rcfcc587 rcf13671 154 154 <ircexample> 155 155 <ircline nick="ctrlsoft">add 3 gryp@jabber.org grijp</ircline> 156 <ircaction nick="grijp" hostmask="gryp@jabber.org">has joined <emphasis> &bitlbee</emphasis></ircaction>156 <ircaction nick="grijp" hostmask="gryp@jabber.org">has joined <emphasis>#bitlbee</emphasis></ircaction> 157 157 </ircexample> 158 158 </bitlbee-command> … … 357 357 <description> 358 358 <para> 359 Some people prefer themself and root to have operator status in &bitlbee, other people don't. You can change these states using this setting.359 Some people prefer themself and root to have operator status in #bitlbee, other people don't. You can change these states using this setting. 360 360 </para> 361 361 -
doc/user-guide/docbook.xsl
rcfcc587 rcf13671 19 19 20 20 <xsl:template match="ircaction"> 21 <xsl:text> * </xsl:text><xsl:value-of select="@nick"/><xsl: text> </xsl:text><xsl:value-of select="normalize-space(.)"/><xsl:text> </xsl:text>21 <xsl:text> * </xsl:text><xsl:value-of select="@nick"/><xsl:value-of select="normalize-space(.)"/><xsl:text> </xsl:text> 22 22 </xsl:template> 23 23 -
doc/user-guide/quickstart.xml
rcfcc587 rcf13671 7 7 8 8 <para> 9 The center of BitlBee is the control channel, <emphasis> &bitlbee</emphasis>. Two users will always be there, <emphasis>you</emphasis> (where "you" is the nickname you are using) and the system user, <emphasis>root</emphasis>.9 The center of BitlBee is the control channel, <emphasis>#bitlbee</emphasis>. Two users will always be there, <emphasis>you</emphasis> (where "you" is the nickname you are using) and the system user, <emphasis>root</emphasis>. 10 10 </para> 11 11 … … 97 97 <ircexample> 98 98 <ircline nick="you">add 0 r2d2@example.com</ircline> 99 <ircaction nick="r2d2"> has joined <emphasis> &bitlbee</emphasis></ircaction>99 <ircaction nick="r2d2"> has joined <emphasis>#bitlbee</emphasis></ircaction> 100 100 </ircexample> 101 101 … … 122 122 123 123 <para> 124 First of all, a person must be on your contact list for you to chat with them (unless it's a group chat, <emphasis>help groupchats</emphasis> for more). If someone not on your contact list sends you a message, simply add them to the proper account with the <emphasis>add</emphasis> command. Once they are on your list and online, you can chat with them in &bitlbee:124 First of all, a person must be on your contact list for you to chat with them (unless it's a group chat, <emphasis>help groupchats</emphasis> for more). If someone not on your contact list sends you a message, simply add them to the proper account with the <emphasis>add</emphasis> command. Once they are on your list and online, you can chat with them in #bitlbee: 125 125 </para> 126 126 … … 131 131 132 132 <para> 133 If you'd rather chat with them in a separate window use the <emphasis>/msg</emphasis> or <emphasis>/query</emphasis> command, just like you would for a private message in IRC. If you want to have messages automatically come up in private messages rather than in the &bitlbee channel, use the <emphasis>set private</emphasis> command: <emphasis>set private true</emphasis> (<emphasis>set private false</emphasis> to change back).133 If you'd rather chat with them in a separate window use the <emphasis>/msg</emphasis> or <emphasis>/query</emphasis> command, just like you would for a private message in IRC. If you want to have messages automatically come up in private messages rather than in the #bitlbee channel, use the <emphasis>set private</emphasis> command: <emphasis>set private true</emphasis> (<emphasis>set private false</emphasis> to change back). 134 134 </para> 135 135 -
irc.c
rcfcc587 rcf13671 600 600 else if ( irc->nick && g_strcasecmp( cmd[1], irc->nick ) == 0 ) 601 601 { 602 irc_write( irc, ":%s!%s@%s %s %s :%s", irc->nick, irc->user, irc->host, cmd[0], cmd[1], cmd[2] );602 irc_write( irc, ":%s!%s@%s PRIVMSG %s :%s", irc->nick, irc->user, irc->host, cmd[1], cmd[2] ); 603 603 } 604 604 else -
protocols/jabber/jabber.c
rcfcc587 rcf13671 757 757 static void jabber_handlemessage(gjconn gjc, jpacket p) 758 758 { 759 xmlnode y, xmlns, z;759 xmlnode y, xmlns, subj, z; 760 760 time_t time_sent = time(NULL); 761 761 762 char *from = NULL, *msg = NULL, *type = NULL ;762 char *from = NULL, *msg = NULL, *type = NULL, *topic = NULL; 763 763 char m[BUF_LONG * 2]; 764 764 … … 798 798 799 799 if (type && !g_strcasecmp(type, "jabber:x:conference")) { 800 /* do nothing */ 800 char *room; 801 GList *m = NULL; 802 char **data; 803 804 room = xmlnode_get_attrib(xmlns, "jid"); 805 data = g_strsplit(room, "@", 2); 806 m = g_list_append(m, g_strdup(data[0])); 807 m = g_list_append(m, g_strdup(data[1])); 808 m = g_list_append(m, g_strdup(gjc->user->user)); 809 g_strfreev(data); 810 811 /* ** Bitlbee ** serv_got_chat_invite(GJ_GC(gjc), room, from, msg, m); */ 801 812 } else if (msg) { /* whisper */ 802 813 struct jabber_chat *jc; … … 806 817 else { 807 818 int flags = 0; 808 809 if(p->from->user) { 810 from = g_strdup_printf("%s@%s", p->from->user, p->from->server); 811 } else { 812 /* server message? */ 813 from = g_strdup(p->from->server); 814 } 815 serv_got_im(GJ_GC(gjc), from, m, flags, time_sent, -1); 816 g_free(from); 819 /* ** Bitlbee ** 820 if (xmlnode_get_tag(p->x, "gaim")) 821 flags = IM_FLAG_GAIMUSER; 822 if (find_conversation(jid_full(p->from))) 823 serv_got_im(GJ_GC(gjc), jid_full(p->from), m, flags, time_sent, -1); 824 else { 825 ** End - Bitlbee ** */ 826 if(p->from->user) { 827 from = g_strdup_printf("%s@%s", p->from->user, p->from->server); 828 } else { 829 /* server message? */ 830 from = g_strdup(p->from->server); 831 } 832 serv_got_im(GJ_GC(gjc), from, m, flags, time_sent, -1); 833 g_free(from); 834 /* ** Bitlbee ** } ** End - Bitlbee ** */ 817 835 } 818 836 } … … 829 847 g_free(from); 830 848 } 831 } else if (!g_strcasecmp(type, "headline")) { 832 char *subject, *body, *url; 849 } else if (!g_strcasecmp(type, "groupchat")) { 850 struct jabber_chat *jc; 851 static int i = 0; 852 853 /* 854 if ((y = xmlnode_get_tag(p->x, "html"))) { 855 msg = xmlnode_get_data(y); 856 } else 857 */ 858 if ((y = xmlnode_get_tag(p->x, "body"))) { 859 msg = xmlnode_get_data(y); 860 } 861 862 msg = utf8_to_str(msg); 833 863 834 y = xmlnode_get_tag( p->x, "body" ); 835 body = y ? g_strdup( xmlnode_get_data( y ) ) : NULL; 836 837 y = xmlnode_get_tag( p->x, "subject" ); 838 subject = y ? g_strdup( xmlnode_get_data( y ) ) : NULL; 839 840 url = NULL; 841 z = xmlnode_get_firstchild(p->x); 842 while( z ) 843 { 844 char *xtype = xmlnode_get_attrib( z, "xmlns" ); 845 846 if( xtype && g_strcasecmp( xtype, "jabber:x:oob" ) == 0 && 847 ( y = xmlnode_get_tag( z, "url" ) ) ) 848 { 849 url = g_strdup( xmlnode_get_data( y ) ); 850 break; 851 } 852 853 z = xmlnode_get_nextsibling( z ); 854 } 855 856 g_snprintf( m, BUF_LONG, "Subject: %s\nURL: %s\nMessage:\n%s", subject ? subject : "(none)", 857 url ? url : "(none)", body ? body : "(none)" ); 858 859 if( p->from->user ) 860 from = g_strdup_printf( "%s@%s", p->from->user, p->from->server ); 861 else 862 from = g_strdup( p->from->server ); 863 864 serv_got_im( GJ_GC(gjc), from, m, 0, time_sent, -1 ); 865 866 g_free( from ); 867 g_free( subject ); 868 g_free( body ); 869 g_free( url ); 864 if ((subj = xmlnode_get_tag(p->x, "subject"))) { 865 topic = xmlnode_get_data(subj); 866 } 867 topic = utf8_to_str(topic); 868 869 jc = find_existing_chat(GJ_GC(gjc), p->from); 870 if (!jc) { 871 /* we're not in this chat. are we supposed to be? */ 872 if ((jc = find_pending_chat(GJ_GC(gjc), p->from)) != NULL) { 873 /* yes, we're supposed to be. so now we are. */ 874 jc->b = serv_got_joined_chat(GJ_GC(gjc), i++, p->from->user); 875 jc->id = jc->b->id; 876 jc->state = JCS_ACTIVE; 877 } else { 878 /* no, we're not supposed to be. */ 879 g_free(msg); 880 return; 881 } 882 } 883 if (p->from->resource) { 884 if (!y) { 885 if (!find_chat_buddy(jc->b, p->from->resource)) { 886 add_chat_buddy(jc->b, p->from->resource); 887 } else if ((y = xmlnode_get_tag(p->x, "status"))) { 888 char *buf; 889 890 buf = g_strdup_printf("%s@%s/%s", 891 p->from->user, p->from->server, p->from->resource); 892 jabber_track_away(gjc, p, buf, NULL); 893 g_free(buf); 894 895 } 896 } else if (jc->b && msg) { 897 char buf[8192]; 898 899 if (topic) { 900 char tbuf[8192]; 901 g_snprintf(tbuf, sizeof(tbuf), "%s", topic); 902 } 903 904 905 g_snprintf(buf, sizeof(buf), "%s", msg); 906 serv_got_chat_in(GJ_GC(gjc), jc->b->id, p->from->resource, 0, buf, time_sent); 907 } 908 } else { /* message from the server */ 909 if(jc->b && topic) { 910 char tbuf[8192]; 911 g_snprintf(tbuf, sizeof(tbuf), "%s", topic); 912 } 913 } 914 915 g_free(msg); 916 g_free(topic); 917 870 918 } 871 919 } -
protocols/nogaim.c
rcfcc587 rcf13671 295 295 { 296 296 va_list params; 297 char text[1024], buf[1024] , acc_id[33];297 char text[1024], buf[1024]; 298 298 char *msg; 299 account_t *a;300 299 301 300 va_start( params, format ); … … 313 312 strip_html( msg ); 314 313 315 /* Try to find a different connection on the same protocol. */ 316 for( a = gc->irc->accounts; a; a = a->next ) 317 if( a->prpl == gc->prpl && a->gc != gc ) 318 break; 319 320 /* If we found one, add the screenname to the acc_id. */ 321 if( a ) 322 g_snprintf( acc_id, 32, "%s(%s)", gc->prpl->name, gc->username ); 323 else 324 g_snprintf( acc_id, 32, "%s", gc->prpl->name ); 325 326 irc_usermsg( gc->irc, "%s - %s", acc_id, msg ); 314 irc_usermsg( gc->irc, "%s(%s) - %s", gc->prpl->name, gc->username, msg ); 327 315 } 328 316 … … 718 706 msg = buf; 719 707 720 while( strlen( msg ) > 4 25)708 while( strlen( msg ) > 450 ) 721 709 { 722 710 char tmp, *nl; 723 711 724 tmp = msg[425]; 725 msg[425] = 0; 726 727 /* If there's a newline/space in this string, split up there, 728 looks a bit prettier. */ 729 if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strchr( msg, ' ' ) ) ) 730 { 731 msg[425] = tmp; 732 tmp = *nl; 712 tmp = msg[450]; 713 msg[450] = 0; 714 715 /* If there's a newline in this string, split up there so we're not 716 going to split up lines. If there isn't a newline, well, too bad. */ 717 if( ( nl = strrchr( msg, '\n' ) ) ) 733 718 *nl = 0; 734 }735 719 736 720 irc_msgfrom( irc, u->nick, msg ); 721 722 msg[450] = tmp; 737 723 738 724 /* Move on. */ 739 725 if( nl ) 740 726 { 741 *nl = tmp;727 *nl = '\n'; 742 728 msg = nl + 1; 743 729 } 744 730 else 745 731 { 746 msg[425] = tmp; 747 msg += 425; 732 msg += 450; 748 733 } 749 734 } … … 759 744 760 745 if( ( u = user_findhandle( gc, handle ) ) ) 761 irc_ msgfrom( gc->irc, u->nick, "\1TYPING 1\1" );746 irc_noticefrom( gc->irc, u->nick, "* Typing a message *" ); 762 747 } 763 748 -
protocols/oscar/Makefile
rcfcc587 rcf13671 10 10 11 11 # [SH] Program variables 12 objects = admin.o auth.o bos.o buddylist.o chat.o chatnav.o conn.o icq.o im.o info.o misc.o msgcookie.o rxhandlers.o rxqueue.o search.o service.o snac.o ssi.o stats.o tlv.o txqueue.o oscar_util.o oscar.o12 objects = admin.o auth.o bos.o buddylist.o chat.o chatnav.o conn.o ft.o icq.o im.o info.o misc.o msgcookie.o rxhandlers.o rxqueue.o search.o service.o snac.o ssi.o stats.o tlv.o txqueue.o oscar_util.o oscar.o 13 13 14 14 CFLAGS += -Wall -
protocols/oscar/aim.h
rcfcc587 rcf13671 168 168 #define AIM_CONN_TYPE_CHATNAV 0x000d 169 169 170 /* they start getting arbitrary in rendezvous stuff =) */ 171 #define AIM_CONN_TYPE_RENDEZVOUS 0x0101 /* these do not speak FLAP! */ 172 #define AIM_CONN_TYPE_RENDEZVOUS_OUT 0x0102 /* socket waiting for accept() */ 173 174 /* 175 * Subtypes, we need these for OFT stuff. 176 */ 177 #define AIM_CONN_SUBTYPE_OFT_DIRECTIM 0x0001 178 #define AIM_CONN_SUBTYPE_OFT_GETFILE 0x0002 179 #define AIM_CONN_SUBTYPE_OFT_SENDFILE 0x0003 180 #define AIM_CONN_SUBTYPE_OFT_BUDDYICON 0x0004 181 #define AIM_CONN_SUBTYPE_OFT_VOICE 0x0005 182 170 183 /* 171 184 * Status values returned from aim_conn_new(). ORed together. … … 178 191 179 192 #define AIM_FRAMETYPE_FLAP 0x0000 193 #define AIM_FRAMETYPE_OFT 0x0001 180 194 181 195 /* … … 244 258 flap_seqnum_t seqnum; 245 259 } flap; 260 struct { 261 guint16 type; 262 guint8 magic[4]; /* ODC2 OFT2 */ 263 guint16 hdr2len; 264 guint8 *hdr2; /* rest of bloated header */ 265 } oft; 246 266 } hdr; 247 267 aim_bstream_t data; /* payload stream */ … … 650 670 #define AIM_COOKIETYPE_CHATNAV 0x06 651 671 #define AIM_COOKIETYPE_INVITE 0x07 672 /* we'll move OFT up a bit to give breathing room. not like it really 673 * matters. */ 674 #define AIM_COOKIETYPE_OFTIM 0x10 675 #define AIM_COOKIETYPE_OFTGET 0x11 676 #define AIM_COOKIETYPE_OFTSEND 0x12 677 #define AIM_COOKIETYPE_OFTVOICE 0x13 678 #define AIM_COOKIETYPE_OFTIMAGE 0x14 679 #define AIM_COOKIETYPE_OFTICON 0x15 652 680 653 681 int aim_handlerendconnect(aim_session_t *sess, aim_conn_t *cur); -
protocols/oscar/aim_internal.h
rcfcc587 rcf13671 192 192 aim_msgcookie_t *aim_checkcookie(aim_session_t *sess, const unsigned char *, const int); 193 193 int aim_freecookie(aim_session_t *sess, aim_msgcookie_t *cookie); 194 int aim_msgcookie_gettype(int reqclass); 194 195 int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie); 195 196 -
protocols/oscar/conn.c
rcfcc587 rcf13671 164 164 * This will free ->internal if it necessary... 165 165 */ 166 if ((*deadconn)->type == AIM_CONN_TYPE_CHAT) 166 if ((*deadconn)->type == AIM_CONN_TYPE_RENDEZVOUS) 167 aim_conn_kill_rend(sess, *deadconn); 168 else if ((*deadconn)->type == AIM_CONN_TYPE_CHAT) 167 169 aim_conn_kill_chat(sess, *deadconn); 168 170 … … 312 314 if (deadconn->handlerlist) 313 315 aim_clearhandlers(deadconn); 316 if (deadconn->type == AIM_CONN_TYPE_RENDEZVOUS) 317 aim_conn_close_rend((aim_session_t *)deadconn->sessv, deadconn); 314 318 315 319 return; -
protocols/oscar/im.c
rcfcc587 rcf13671 2039 2039 */ 2040 2040 aimbs_put8(&fr->data, strlen(sn)); 2041 aimbs_putraw(&fr->data, (const guint8*)sn, strlen(sn));2041 aimbs_putraw(&fr->data, sn, strlen(sn)); 2042 2042 2043 2043 /* -
protocols/oscar/msgcookie.c
rcfcc587 rcf13671 178 178 return 0; 179 179 } 180 181 /* XXX I hate switch */ 182 int aim_msgcookie_gettype(int reqclass) 183 { 184 /* XXX: hokey-assed. needs fixed. */ 185 switch(reqclass) { 186 case AIM_CAPS_BUDDYICON: return AIM_COOKIETYPE_OFTICON; 187 case AIM_CAPS_VOICE: return AIM_COOKIETYPE_OFTVOICE; 188 case AIM_CAPS_IMIMAGE: return AIM_COOKIETYPE_OFTIMAGE; 189 case AIM_CAPS_CHAT: return AIM_COOKIETYPE_CHAT; 190 case AIM_CAPS_GETFILE: return AIM_COOKIETYPE_OFTGET; 191 case AIM_CAPS_SENDFILE: return AIM_COOKIETYPE_OFTSEND; 192 default: return AIM_COOKIETYPE_UNKNOWN; 193 } 194 } 195 196 -
protocols/oscar/oscar.c
rcfcc587 rcf13671 275 275 276 276 if (condition & GAIM_INPUT_READ) { 277 if ( aim_get_command(odata->sess, conn) >= 0) {278 aim_rxdispatch(odata->sess);279 if (odata->killme) 280 signoff(gc); 277 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) { 278 if (aim_handlerendconnect(odata->sess, conn) < 0) { 279 aim_conn_kill(odata->sess, &conn); 280 } 281 281 } else { 282 if ((conn->type == AIM_CONN_TYPE_BOS) || 283 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) { 284 hide_login_progress_error(gc, _("Disconnected.")); 285 signoff(gc); 286 } else if (conn->type == AIM_CONN_TYPE_CHAT) { 287 struct chat_connection *c = find_oscar_chat_by_conn(gc, conn); 288 char buf[BUF_LONG]; 289 c->conn = NULL; 290 if (c->inpa > 0) 291 gaim_input_remove(c->inpa); 292 c->inpa = 0; 293 c->fd = -1; 294 aim_conn_kill(odata->sess, &conn); 295 sprintf(buf, _("You have been disconnected from chat room %s."), c->name); 296 do_error_dialog(sess->aux_data, buf, _("Chat Error!")); 297 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) { 298 if (odata->cnpa > 0) 299 gaim_input_remove(odata->cnpa); 300 odata->cnpa = 0; 301 while (odata->create_rooms) { 302 struct create_room *cr = odata->create_rooms->data; 303 g_free(cr->name); 304 odata->create_rooms = 305 g_slist_remove(odata->create_rooms, cr); 306 g_free(cr); 307 do_error_dialog(sess->aux_data, _("Chat is currently unavailable"), 308 _("Gaim - Chat")); 282 if (aim_get_command(odata->sess, conn) >= 0) { 283 aim_rxdispatch(odata->sess); 284 if (odata->killme) 285 signoff(gc); 286 } else { 287 if ((conn->type == AIM_CONN_TYPE_BOS) || 288 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) { 289 hide_login_progress_error(gc, _("Disconnected.")); 290 signoff(gc); 291 } else if (conn->type == AIM_CONN_TYPE_CHAT) { 292 struct chat_connection *c = find_oscar_chat_by_conn(gc, conn); 293 char buf[BUF_LONG]; 294 c->conn = NULL; 295 if (c->inpa > 0) 296 gaim_input_remove(c->inpa); 297 c->inpa = 0; 298 c->fd = -1; 299 aim_conn_kill(odata->sess, &conn); 300 sprintf(buf, _("You have been disconnected from chat room %s."), c->name); 301 do_error_dialog(sess->aux_data, buf, _("Chat Error!")); 302 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) { 303 if (odata->cnpa > 0) 304 gaim_input_remove(odata->cnpa); 305 odata->cnpa = 0; 306 while (odata->create_rooms) { 307 struct create_room *cr = odata->create_rooms->data; 308 g_free(cr->name); 309 odata->create_rooms = 310 g_slist_remove(odata->create_rooms, cr); 311 g_free(cr); 312 do_error_dialog(sess->aux_data, _("Chat is currently unavailable"), 313 _("Gaim - Chat")); 314 } 315 aim_conn_kill(odata->sess, &conn); 316 } else if (conn->type == AIM_CONN_TYPE_AUTH) { 317 if (odata->paspa > 0) 318 gaim_input_remove(odata->paspa); 319 odata->paspa = 0; 320 aim_conn_kill(odata->sess, &conn); 321 } else { 322 aim_conn_kill(odata->sess, &conn); 309 323 } 310 aim_conn_kill(odata->sess, &conn);311 } else if (conn->type == AIM_CONN_TYPE_AUTH) {312 if (odata->paspa > 0)313 gaim_input_remove(odata->paspa);314 odata->paspa = 0;315 aim_conn_kill(odata->sess, &conn);316 } else {317 aim_conn_kill(odata->sess, &conn);318 324 } 319 325 } -
protocols/oscar/rxhandlers.c
rcfcc587 rcf13671 341 341 continue; 342 342 343 /* 344 * This is a debugging/sanity check only and probably 345 * could/should be removed for stable code. 346 */ 347 if (((cur->hdrtype == AIM_FRAMETYPE_OFT) && 348 (cur->conn->type != AIM_CONN_TYPE_RENDEZVOUS)) || 349 ((cur->hdrtype == AIM_FRAMETYPE_FLAP) && 350 (cur->conn->type == AIM_CONN_TYPE_RENDEZVOUS))) { 351 do_error_dialog(sess->aux_data, "incompatible frame type/connection type combination", "Gaim"); 352 cur->handled = 1; 353 continue; 354 } 355 356 if (cur->conn->type == AIM_CONN_TYPE_RENDEZVOUS) { 357 if (cur->hdrtype != AIM_FRAMETYPE_OFT) { 358 do_error_dialog(sess->aux_data, "non-OFT frames on OFT connection", "Gaim"); 359 cur->handled = 1; /* get rid of it */ 360 } else { 361 /* FIXME: implement this (OFT frame) */ 362 cur->handled = 1; /* get rid of it */ 363 } 364 continue; 365 } 366 367 if (cur->conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) { 368 /* not possible */ 369 do_error_dialog(sess->aux_data, "RENDEZVOUS packet in rxqueue", "Gaim"); 370 cur->handled = 1; 371 continue; 372 } 373 343 374 if (cur->hdr.flap.type == 0x01) { 344 375 -
protocols/oscar/rxqueue.c
rcfcc587 rcf13671 332 332 g_free(frame->data.data); /* XXX aim_bstream_free */ 333 333 334 if (frame->hdrtype == AIM_FRAMETYPE_OFT) 335 g_free(frame->hdr.oft.hdr2); 334 336 g_free(frame); 337 338 return; 335 339 } 336 340 … … 358 362 if (conn->status & AIM_CONN_STATUS_INPROGRESS) 359 363 return aim_conn_completeconnect(sess, conn); 364 365 /* 366 * Rendezvous (client-client) connections do not speak 367 * FLAP, so this function will break on them. 368 */ 369 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS) 370 return aim_get_command_rendezvous(sess, conn); 371 else if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) { 372 do_error_dialog(sess->aux_data,"AIM_CONN_TYPE_RENDEZVOUS_OUT shouldn't use FLAP", "Gaim"); 373 return 0; 374 } 360 375 361 376 aim_bstream_init(&flaphdr, flaphdr_raw, sizeof(flaphdr_raw)); -
protocols/oscar/txqueue.c
rcfcc587 rcf13671 34 34 } 35 35 36 /* For sanity... */ 37 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) || 38 (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT)) { 39 if (framing != AIM_FRAMETYPE_OFT) { 40 do_error_dialog(sess->aux_data, "attempted to allocate inappropriate frame type for rendezvous connection", "Gaim"); 41 return NULL; 42 } 43 } else { 44 if (framing != AIM_FRAMETYPE_FLAP) { 45 do_error_dialog(sess->aux_data, "attempted to allocate inappropriate frame type for FLAP connection", "Gaim"); 46 return NULL; 47 } 48 } 49 36 50 if (!(fr = (aim_frame_t *)g_new0(aim_frame_t,1))) 37 51 return NULL; … … 44 58 45 59 fr->hdr.flap.type = chan; 60 61 } else if (fr->hdrtype == AIM_FRAMETYPE_OFT) { 62 63 fr->hdr.oft.type = chan; 64 fr->hdr.oft.hdr2len = 0; /* this will get setup by caller */ 46 65 47 66 } else … … 218 237 219 238 if (count) { 239 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) && 240 (conn->subtype == AIM_CONN_SUBTYPE_OFT_DIRECTIM)) { 241 /* I strongly suspect that this is a horrible thing to do 242 * and I feel really guilty doing it. */ 243 const char *sn = aim_directim_getsn(conn); 244 aim_rxcallback_t userfunc; 245 while (count - wrote > 1024) { 246 wrote = wrote + aim_send(conn->fd, bs->data + bs->offset + wrote, 1024); 247 if ((userfunc=aim_callhandler(conn->sessv, conn, 248 AIM_CB_FAM_SPECIAL, 249 AIM_CB_SPECIAL_IMAGETRANSFER))) 250 userfunc(conn->sessv, NULL, sn, 251 count-wrote>1024 ? ((double)wrote / count) : 1); 252 } 253 } 220 254 if (count - wrote) { 221 255 wrote = wrote + aim_send(conn->fd, bs->data + bs->offset + wrote, count - wrote); … … 265 299 } 266 300 301 static int sendframe_oft(aim_session_t *sess, aim_frame_t *fr) 302 { 303 aim_bstream_t hbs; 304 guint8 *hbs_raw; 305 int hbslen; 306 int err = 0; 307 308 hbslen = 8 + fr->hdr.oft.hdr2len; 309 if (!(hbs_raw = g_malloc(hbslen))) 310 return -1; 311 312 aim_bstream_init(&hbs, hbs_raw, hbslen); 313 314 aimbs_putraw(&hbs, fr->hdr.oft.magic, 4); 315 aimbs_put16(&hbs, fr->hdr.oft.hdr2len + 8); 316 aimbs_put16(&hbs, fr->hdr.oft.type); 317 aimbs_putraw(&hbs, fr->hdr.oft.hdr2, fr->hdr.oft.hdr2len); 318 319 aim_bstream_rewind(&hbs); 320 321 322 if (aim_bstream_send(&hbs, fr->conn, hbslen) != hbslen) { 323 324 err = -errno; 325 326 } else if (aim_bstream_curpos(&fr->data)) { 327 int len; 328 329 len = aim_bstream_curpos(&fr->data); 330 aim_bstream_rewind(&fr->data); 331 332 if (aim_bstream_send(&fr->data, fr->conn, len) != len) 333 err = -errno; 334 } 335 336 g_free(hbs_raw); /* XXX aim_bstream_free */ 337 338 fr->handled = 1; 339 fr->conn->lastactivity = time(NULL); 340 341 342 return err; 343 344 345 } 346 267 347 int aim_tx_sendframe(aim_session_t *sess, aim_frame_t *fr) 268 348 { 269 349 if (fr->hdrtype == AIM_FRAMETYPE_FLAP) 270 350 return sendframe_flap(sess, fr); 351 else if (fr->hdrtype == AIM_FRAMETYPE_OFT) 352 return sendframe_oft(sess, fr); 271 353 return -1; 272 354 }
Note: See TracChangeset
for help on using the changeset viewer.