You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(106) |
Oct
(334) |
Nov
(246) |
Dec
(145) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(53) |
Mar
(232) |
Apr
(109) |
May
(137) |
Jun
(63) |
Jul
(26) |
Aug
(263) |
Sep
(193) |
Oct
(507) |
Nov
(440) |
Dec
(241) |
2003 |
Jan
(567) |
Feb
(195) |
Mar
(504) |
Apr
(481) |
May
(524) |
Jun
(522) |
Jul
(594) |
Aug
(502) |
Sep
(643) |
Oct
(508) |
Nov
(430) |
Dec
(377) |
2004 |
Jan
(361) |
Feb
(251) |
Mar
(219) |
Apr
(499) |
May
(461) |
Jun
(419) |
Jul
(314) |
Aug
(519) |
Sep
(416) |
Oct
(247) |
Nov
(305) |
Dec
(382) |
2005 |
Jan
(267) |
Feb
(282) |
Mar
(327) |
Apr
(338) |
May
(189) |
Jun
(400) |
Jul
(462) |
Aug
(530) |
Sep
(316) |
Oct
(523) |
Nov
(481) |
Dec
(650) |
2006 |
Jan
(536) |
Feb
(361) |
Mar
(287) |
Apr
(146) |
May
(101) |
Jun
(169) |
Jul
(221) |
Aug
(498) |
Sep
(300) |
Oct
(236) |
Nov
(209) |
Dec
(205) |
2007 |
Jan
(30) |
Feb
(23) |
Mar
(26) |
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Eric W. <war...@us...> - 2001-11-10 08:02:42
|
Update of /cvsroot/gaim/gaim/src/protocols/toc In directory usw-pr-cvs1:/tmp/cvs-serv20536/src/protocols/toc Modified Files: toc.c Log Message: oh Index: toc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/toc/toc.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- toc.c 2001/11/06 23:58:24 1.31 +++ toc.c 2001/11/10 08:02:40 1.32 @@ -144,6 +144,7 @@ gc = new_gaim_conn(user); gc->proto_data = tdt = g_new0(struct toc_data, 1); + gc->flags |= OPT_CONN_HTML; g_snprintf(buf, sizeof buf, "Looking up %s", user->proto_opt[USEROPT_AUTH][0] ? user->proto_opt[USEROPT_AUTH] : TOC_HOST); @@ -1363,7 +1364,7 @@ void toc_init(struct prpl *ret) { ret->protocol = PROTO_TOC; - ret->options = OPT_PROTO_HTML | OPT_PROTO_CORRECT_TIME; + ret->options = OPT_PROTO_CORRECT_TIME; ret->name = toc_name; ret->list_icon = toc_list_icon; ret->away_states = toc_away_states; |
From: Eric W. <war...@us...> - 2001-11-10 08:02:42
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory usw-pr-cvs1:/tmp/cvs-serv20536/src/protocols/oscar Modified Files: aim.h aim_cbtypes.h aim_internal.h icq.c oscar.c rxqueue.c Log Message: oh Index: aim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/aim.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- aim.h 2001/11/10 02:07:37 1.17 +++ aim.h 2001/11/10 08:02:39 1.18 @@ -966,6 +966,17 @@ faim_export int aim_ssi_modbegin(aim_session_t *sess, aim_conn_t *conn); faim_export int aim_ssi_modend(aim_session_t *sess, aim_conn_t *conn); +struct aim_icq_offlinemsg { + fu32_t sender; + fu16_t year; + fu8_t month, day, hour, minute; + fu16_t type; + char *msg; +}; + +faim_export int aim_icq_reqofflinemsgs(aim_session_t *sess); +faim_export int aim_icq_ackofflinemsgs(aim_session_t *sess); + /* aim_util.c */ /* * These are really ugly. You'd think this was LISP. I wish it was. @@ -991,6 +1002,34 @@ (((*((buf)+1))<<16)&0x00ff0000) + \ (((*((buf)+2))<< 8)&0x0000ff00) + \ (((*((buf)+3) )&0x000000ff))) + +/* Little-endian versions (damn ICQ) */ +#define aimutil_putle8(buf, data) ( \ + (*(buf) = (unsigned char)(data) & 0xff), \ + 1) +#define aimutil_getle8(buf) ( \ + (*(buf)) & 0xff \ + ) +#define aimutil_putle16(buf, data) ( \ + (*((buf)+0) = (unsigned char)((data) >> 0) & 0xff), \ + (*((buf)+1) = (unsigned char)((data) >> 8) & 0xff), \ + 2) +#define aimutil_getle16(buf) ( \ + (((*((buf)+0)) << 0) & 0x00ff) + \ + (((*((buf)+1)) << 8) & 0xff00) \ + ) +#define aimutil_putle32(buf, data) ( \ + (*((buf)+0) = (unsigned char)((data) >> 0) & 0xff), \ + (*((buf)+1) = (unsigned char)((data) >> 8) & 0xff), \ + (*((buf)+2) = (unsigned char)((data) >> 16) & 0xff), \ + (*((buf)+3) = (unsigned char)((data) >> 24) & 0xff), \ + 4) +#define aimutil_getle32(buf) ( \ + (((*((buf)+0)) << 0) & 0x000000ff) + \ + (((*((buf)+1)) << 8) & 0x0000ff00) + \ + (((*((buf)+2)) << 16) & 0x00ff0000) + \ + (((*((buf)+3)) << 24) & 0xff000000)) + faim_export int aimutil_putstr(u_char *, const char *, int); faim_export int aimutil_tokslen(char *toSearch, int index, char dl); Index: aim_cbtypes.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/aim_cbtypes.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- aim_cbtypes.h 2001/11/05 12:25:22 1.2 +++ aim_cbtypes.h 2001/11/10 08:02:39 1.3 @@ -23,6 +23,7 @@ #define AIM_CB_FAM_TRN 0x000c #define AIM_CB_FAM_CTN 0x000d /* ChatNav */ #define AIM_CB_FAM_CHT 0x000e /* Chat */ +#define AIM_CB_FAM_ICQ 0x0015 #define AIM_CB_FAM_ATH 0x0017 #define AIM_CB_FAM_OFT 0xfffe /* OFT/Rvous */ #define AIM_CB_FAM_SPECIAL 0xffff /* Internal libfaim use */ @@ -170,6 +171,16 @@ #define AIM_CB_CHT_OUTGOINGMSG 0x0005 #define AIM_CB_CHT_INCOMINGMSG 0x0006 #define AIM_CB_CHT_DEFAULT 0xffff + +/* + * SNAC Family: ICQ + * + * Most of these are actually special. + */ +#define AIM_CB_ICQ_ERROR 0x0001 +#define AIM_CB_ICQ_OFFLINEMSG 0x00f0 +#define AIM_CB_ICQ_OFFLINEMSGCOMPLETE 0x00f1 +#define AIM_CB_ICQ_DEFAULT 0xffff /* * SNAC Family: Authorizer Index: aim_internal.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/aim_internal.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- aim_internal.h 2001/11/10 01:48:17 1.7 +++ aim_internal.h 2001/11/10 08:02:39 1.8 @@ -72,9 +72,15 @@ faim_internal fu8_t aimbs_get8(aim_bstream_t *bs); faim_internal fu16_t aimbs_get16(aim_bstream_t *bs); faim_internal fu32_t aimbs_get32(aim_bstream_t *bs); +faim_internal fu8_t aimbs_getle8(aim_bstream_t *bs); +faim_internal fu16_t aimbs_getle16(aim_bstream_t *bs); +faim_internal fu32_t aimbs_getle32(aim_bstream_t *bs); faim_internal int aimbs_put8(aim_bstream_t *bs, fu8_t v); faim_internal int aimbs_put16(aim_bstream_t *bs, fu16_t v); faim_internal int aimbs_put32(aim_bstream_t *bs, fu32_t v); +faim_internal int aimbs_putle8(aim_bstream_t *bs, fu8_t v); +faim_internal int aimbs_putle16(aim_bstream_t *bs, fu16_t v); +faim_internal int aimbs_putle32(aim_bstream_t *bs, fu32_t v); faim_internal int aimbs_getrawbuf(aim_bstream_t *bs, fu8_t *buf, int len); faim_internal fu8_t *aimbs_getraw(aim_bstream_t *bs, int len); faim_internal char *aimbs_getstr(aim_bstream_t *bs, int len); Index: icq.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/icq.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- icq.c 2001/11/10 01:48:17 1.1 +++ icq.c 2001/11/10 08:02:39 1.2 @@ -6,16 +6,162 @@ #define FAIM_INTERNAL #include <aim.h> +faim_export int aim_icq_reqofflinemsgs(aim_session_t *sess) +{ + aim_conn_t *conn; + aim_frame_t *fr; + aim_snacid_t snacid; + int bslen; + + if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015))) + return -EINVAL; + + bslen = 2 + 4 + 2 + 2; + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen))) + return -ENOMEM; + + snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0); + aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid); + + /* For simplicity, don't bother using a tlvlist */ + aimbs_put16(&fr->data, 0x0001); + aimbs_put16(&fr->data, bslen); + + aimbs_putle16(&fr->data, bslen - 2); + aimbs_putle32(&fr->data, atoi(sess->sn)); + aimbs_putle16(&fr->data, 0x003c); /* I command thee. */ + aimbs_putle16(&fr->data, snacid); /* eh. */ + + aim_tx_enqueue(sess, fr); + + return 0; +} + +faim_export int aim_icq_ackofflinemsgs(aim_session_t *sess) +{ + aim_conn_t *conn; + aim_frame_t *fr; + aim_snacid_t snacid; + int bslen; + + if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015))) + return -EINVAL; + + bslen = 2 + 4 + 2 + 2; + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen))) + return -ENOMEM; + + snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0); + aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid); + + /* For simplicity, don't bother using a tlvlist */ + aimbs_put16(&fr->data, 0x0001); + aimbs_put16(&fr->data, bslen); + + aimbs_putle16(&fr->data, bslen - 2); + aimbs_putle32(&fr->data, atoi(sess->sn)); + aimbs_putle16(&fr->data, 0x003e); /* I command thee. */ + aimbs_putle16(&fr->data, snacid); /* eh. */ + + aim_tx_enqueue(sess, fr); + + return 0; +} + +faim_export int aim_icq_sendxmlreq(aim_session_t *sess, const char *xml) +{ + aim_conn_t *conn; + aim_frame_t *fr; + aim_snacid_t snacid; + int bslen; + + if (!xml || !strlen(xml)) + return -EINVAL; + + if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015))) + return -EINVAL; + + bslen = 2 + 10 + 2 + strlen(xml) + 1; + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen))) + return -ENOMEM; + + snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0); + aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid); + + /* For simplicity, don't bother using a tlvlist */ + aimbs_put16(&fr->data, 0x0001); + aimbs_put16(&fr->data, bslen); + + aimbs_putle16(&fr->data, bslen - 2); + aimbs_putle32(&fr->data, atoi(sess->sn)); + aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */ + aimbs_putle16(&fr->data, snacid); /* eh. */ + aimbs_putle16(&fr->data, 0x0998); /* shrug. */ + aimbs_putle16(&fr->data, strlen(xml) + 1); + aimbs_putraw(&fr->data, xml, strlen(xml) + 1); + + aim_tx_enqueue(sess, fr); + + return 0; +} + /* * Response to 15/2, contains an ICQ packet. */ static int icqresponse(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { int ret = 0; - aim_rxcallback_t userfunc; + aim_tlvlist_t *tl; + aim_tlv_t *datatlv; + aim_bstream_t qbs; + fu32_t ouruin; + fu16_t cmdlen, cmd, reqid; - if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) - ret = userfunc(sess, rx); + if (!(tl = aim_readtlvchain(bs)) || !(datatlv = aim_gettlv(tl, 0x0001, 1))) { + faimdprintf(sess, 0, "corrupt ICQ response\n"); + return 0; + } + + aim_bstream_init(&qbs, datatlv->value, datatlv->length); + + cmdlen = aimbs_getle16(&qbs); + ouruin = aimbs_getle32(&qbs); + cmd = aimbs_getle16(&qbs); + reqid = aimbs_getle16(&qbs); + + faimdprintf(sess, 1, "icq response: %d bytes, %ld, 0x%04x, 0x%04x\n", cmdlen, ouruin, cmd, reqid); + + if (cmd == 0x0041) { + fu16_t msglen; + struct aim_icq_offlinemsg msg; + aim_rxcallback_t userfunc; + + memset(&msg, 0, sizeof(msg)); + + msg.sender = aimbs_getle32(&qbs); + msg.year = aimbs_getle16(&qbs); + msg.month = aimbs_getle8(&qbs); + msg.day = aimbs_getle8(&qbs); + msg.hour = aimbs_getle8(&qbs); + msg.minute = aimbs_getle8(&qbs); + msg.type = aimbs_getle16(&qbs); + msglen = aimbs_getle16(&qbs); + msg.msg = aimbs_getstr(&qbs, msglen); + + if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSG))) + ret = userfunc(sess, rx, &msg); + + free(msg.msg); + + } else if (cmd == 0x0042) { + aim_rxcallback_t userfunc; + + if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSGCOMPLETE))) + ret = userfunc(sess, rx); + } return ret; } Index: oscar.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- oscar.c 2001/11/10 02:07:37 1.62 +++ oscar.c 2001/11/10 08:02:39 1.63 @@ -240,6 +240,8 @@ static int gaim_parse_genericerr (aim_session_t *, aim_frame_t *, ...); static int gaim_memrequest (aim_session_t *, aim_frame_t*, ...); static int gaim_selfinfo (aim_session_t *, aim_frame_t*, ...); +static int gaim_offlinemsg (aim_session_t *, aim_frame_t*, ...); +static int gaim_offlinemsgdone (aim_session_t *, aim_frame_t*, ...); static int gaim_directim_initiate (aim_session_t *, aim_frame_t *, ...); static int gaim_directim_incoming (aim_session_t *, aim_frame_t *, ...); @@ -445,8 +447,11 @@ odata->icq = TRUE; /* this is odd but it's necessary for a proper do_import and do_export */ gc->protocol = PROTO_ICQ; - } else + gc->checkbox = _("Send offline message"); + } else { gc->protocol = PROTO_TOC; + gc->flags |= OPT_CONN_HTML; + } sess = g_new0(aim_session_t, 1); @@ -645,6 +650,8 @@ aim_conn_addhandler(sess, bosconn, 0x0009, 0x0001, gaim_parse_genericerr, 0); aim_conn_addhandler(sess, bosconn, 0x0001, 0x001f, gaim_memrequest, 0); aim_conn_addhandler(sess, bosconn, 0x0001, 0x000f, gaim_selfinfo, 0); + aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSG, gaim_offlinemsg, 0); + aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSGCOMPLETE, gaim_offlinemsgdone, 0); ((struct oscar_data *)gc->proto_data)->conn = bosconn; for (i = 0; i < (int)strlen(info->bosip); i++) { @@ -1979,11 +1986,40 @@ aim_clientready(sess, fr->conn); + aim_icq_reqofflinemsgs(sess); + aim_reqservice(sess, fr->conn, AIM_CONN_TYPE_CHATNAV); return 1; } +static int gaim_offlinemsg(aim_session_t *sess, aim_frame_t *fr, ...) { + va_list ap; + struct aim_icq_offlinemsg *msg; + struct gaim_connection *gc = sess->aux_data; + + va_start(ap, fr); + msg = va_arg(ap, struct aim_icq_offlinemsg *); + va_end(ap); + + if (msg->type == 0x0001) { + char sender[32]; + time_t t = get_time(msg->year, msg->month, msg->day, msg->hour, msg->minute, 0); + g_snprintf(sender, sizeof(sender), "%lu", msg->sender); + serv_got_im(gc, sender, msg->msg, 0, t); + } else { + debug_printf("unknown offline message type 0x%04x\n", msg->type); + } + + return 1; +} + +static int gaim_offlinemsgdone(aim_session_t *sess, aim_frame_t *fr, ...) +{ + aim_icq_ackofflinemsgs(sess); + return 1; +} + static int gaim_parse_searchreply(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; char *address, *SNs; @@ -2088,9 +2124,11 @@ if (dim) { ret = aim_send_im_direct(odata->sess, dim->conn, message); } else { - if (imflags & IM_FLAG_AWAY) + if (imflags & IM_FLAG_AWAY) { ret = aim_send_im(odata->sess, name, AIM_IMFLAGS_AWAY, message); - else { + } else if (imflags & IM_FLAG_CHECKBOX) { + ret = aim_send_im(odata->sess, name, AIM_IMFLAGS_OFFLINE, message); + } else { struct aim_sendimext_args args; GSList *h = odata->hasicons; struct icon_req *ir = NULL; @@ -2771,7 +2809,7 @@ void oscar_init(struct prpl *ret) { ret->protocol = PROTO_OSCAR; - ret->options = OPT_PROTO_HTML | OPT_PROTO_BUDDY_ICON; + ret->options = OPT_PROTO_BUDDY_ICON; ret->name = oscar_name; ret->list_icon = oscar_list_icon; ret->away_states = oscar_away_states; Index: rxqueue.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/rxqueue.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- rxqueue.c 2001/09/12 00:39:51 1.3 +++ rxqueue.c 2001/11/10 08:02:39 1.4 @@ -149,6 +149,39 @@ return aimutil_get32(bs->data + bs->offset - 4); } +faim_internal fu8_t aimbs_getle8(aim_bstream_t *bs) +{ + + if (aim_bstream_empty(bs) < 1) + return 0; /* XXX throw an exception */ + + bs->offset++; + + return aimutil_getle8(bs->data + bs->offset - 1); +} + +faim_internal fu16_t aimbs_getle16(aim_bstream_t *bs) +{ + + if (aim_bstream_empty(bs) < 2) + return 0; /* XXX throw an exception */ + + bs->offset += 2; + + return aimutil_getle16(bs->data + bs->offset - 2); +} + +faim_internal fu32_t aimbs_getle32(aim_bstream_t *bs) +{ + + if (aim_bstream_empty(bs) < 4) + return 0; /* XXX throw an exception */ + + bs->offset += 4; + + return aimutil_getle32(bs->data + bs->offset - 4); +} + faim_internal int aimbs_put8(aim_bstream_t *bs, fu8_t v) { @@ -178,6 +211,39 @@ return 0; /* XXX throw an exception */ bs->offset += aimutil_put32(bs->data + bs->offset, v); + + return 1; +} + +faim_internal int aimbs_putle8(aim_bstream_t *bs, fu8_t v) +{ + + if (aim_bstream_empty(bs) < 1) + return 0; /* XXX throw an exception */ + + bs->offset += aimutil_putle8(bs->data + bs->offset, v); + + return 1; +} + +faim_internal int aimbs_putle16(aim_bstream_t *bs, fu16_t v) +{ + + if (aim_bstream_empty(bs) < 2) + return 0; /* XXX throw an exception */ + + bs->offset += aimutil_putle16(bs->data + bs->offset, v); + + return 2; +} + +faim_internal int aimbs_putle32(aim_bstream_t *bs, fu32_t v) +{ + + if (aim_bstream_empty(bs) < 4) + return 0; /* XXX throw an exception */ + + bs->offset += aimutil_putle32(bs->data + bs->offset, v); return 1; } |
From: Eric W. <war...@us...> - 2001-11-10 08:02:42
|
Update of /cvsroot/gaim/gaim/src/protocols/icq In directory usw-pr-cvs1:/tmp/cvs-serv20536/src/protocols/icq Modified Files: gaim_icq.c Log Message: oh Index: gaim_icq.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/icq/gaim_icq.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- gaim_icq.c 2001/11/06 23:58:21 1.19 +++ gaim_icq.c 2001/11/10 08:02:39 1.20 @@ -302,6 +302,8 @@ icq_Link *link; char ps[9]; + gc->checkbox = _("Send message through server"); + icq_LogLevel = ICQ_LOG_MESSAGE; g_snprintf(ps, sizeof(ps), "%s", user->password); @@ -500,7 +502,6 @@ void icq_init(struct prpl *ret) { ret->protocol = PROTO_ICQ; - ret->checkbox = "Send message through server"; ret->name = icq_name; ret->list_icon = icq_list_icon; ret->away_states = icq_away_states; |
From: Eric W. <war...@us...> - 2001-11-10 08:02:42
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv20536/src Modified Files: conversation.c gaim.h multi.h prpl.h server.c Log Message: oh Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.291 retrieving revision 1.292 diff -u -d -r1.291 -r1.292 --- conversation.c 2001/11/09 03:11:56 1.291 +++ conversation.c 2001/11/10 08:02:39 1.292 @@ -812,7 +812,7 @@ buf2 = g_malloc(limit); - if (c->gc->prpl->options & OPT_PROTO_HTML) { + if (c->gc->flags & OPT_CONN_HTML) { if (convo_options & OPT_CONVO_SEND_LINKS) linkify_text(buf); @@ -2926,10 +2926,10 @@ if (!c->gc) return; - if (!c->gc->prpl->checkbox) + if (!c->gc->checkbox) return; - c->check = gtk_check_button_new_with_label(c->gc->prpl->checkbox); + c->check = gtk_check_button_new_with_label(c->gc->checkbox); gtk_box_pack_start(GTK_BOX(c->lbox), c->check, FALSE, FALSE, 5); gtk_widget_show(c->check); } Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.290 retrieving revision 1.291 diff -u -d -r1.290 -r1.291 --- gaim.h 2001/11/06 23:58:21 1.290 +++ gaim.h 2001/11/10 08:02:39 1.291 @@ -403,5 +403,6 @@ extern char *str_to_utf8(unsigned char *); extern char *add_cr(char *); extern void strip_linefeed(char *); +extern time_t get_time(int, int, int, int, int, int); #endif /* _GAIM_H_ */ Index: multi.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/multi.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- multi.h 2001/10/06 00:10:29 1.36 +++ multi.h 2001/11/10 08:02:39 1.37 @@ -32,6 +32,10 @@ /* we make this as an int in case if we want to add more protocols later */ int protocol; struct prpl *prpl; + guint32 flags; + + /* erg. */ + char *checkbox; /* all connections need an input watcher */ int inpa; @@ -68,6 +72,8 @@ int evil; gboolean wants_to_die; /* defaults to FALSE */ }; + +#define OPT_CONN_HTML 0x00000001 struct proto_user_opt { char *label; Index: prpl.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- prpl.h 2001/11/06 23:58:21 1.55 +++ prpl.h 2001/11/10 08:02:39 1.56 @@ -55,7 +55,7 @@ /* These should all be stuff that some plugins can do and others can't */ /* TOC/Oscar send HTML-encoded messages; most other protocols don't */ -#define OPT_PROTO_HTML 0x00000001 +/* #define OPT_PROTO_HTML 0x00000001 this should be per-connection */ /* TOC/Oscar have signon time, and the server's time needs to be adjusted to match * your computer's time. We wouldn't need this if everyone used NTP. */ #define OPT_PROTO_CORRECT_TIME 0x00000002 @@ -81,7 +81,7 @@ char *(* name)(); /* for ICQ and Yahoo, who have off/on per-conversation options */ - char *checkbox; + /* char *checkbox; this should be per-connection */ /* returns the XPM associated with the given user class */ char **(* list_icon)(int); Index: server.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/server.c,v retrieving revision 1.207 retrieving revision 1.208 diff -u -d -r1.207 -r1.208 --- server.c 2001/11/06 23:58:21 1.207 +++ server.c 2001/11/10 08:02:39 1.208 @@ -187,7 +187,7 @@ char *buf = NULL; if (message) { buf = g_malloc(strlen(message) + 1); - if (gc->prpl->options & OPT_PROTO_HTML) + if (gc->flags & OPT_CONN_HTML) strncpy(buf, message, strlen(message) + 1); else strncpy_nohtml(buf, message, strlen(message) + 1); |
From: Eric W. <war...@us...> - 2001-11-10 08:02:42
|
Update of /cvsroot/gaim/gaim/src/protocols/gg In directory usw-pr-cvs1:/tmp/cvs-serv20536/src/protocols/gg Modified Files: gg.c Log Message: oh Index: gg.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/gg/gg.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gg.c 2001/11/06 23:58:21 1.8 +++ gg.c 2001/11/10 08:02:39 1.9 @@ -534,6 +534,8 @@ struct agg_data *gd = gc->proto_data = g_new0(struct agg_data, 1); char buf[80]; + gc->checkbox = _("Send as message"); + gd->sess = g_new0(struct gg_session, 1); if (user->proto_opt[USEROPT_NICK][0]) @@ -957,7 +959,6 @@ ret->protocol = PROTO_GADUGADU; ret->options = 0; ret->name = agg_name; - ret->checkbox = _("Send as message"); ret->list_icon = agg_list_icon; ret->away_states = agg_away_states; ret->actions = agg_actions; |
From: Eric W. <war...@us...> - 2001-11-10 03:50:55
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv20345 Modified Files: gtkimhtml.c Log Message: no, that didn't work well. what's the right fix? god i hate fonts. Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- gtkimhtml.c 2001/11/10 01:05:19 1.71 +++ gtkimhtml.c 2001/11/10 03:50:52 1.72 @@ -1928,8 +1928,13 @@ newvals [NAME] = names [i]; if (xflds [PTSZ][0]) { - newvals [PTSZ] = xflds [PTSZ]; + g_snprintf (fs, sizeof (fs), "%d", + font_sizes [MIN (fontsize, MAX_SIZE) - 1] / 10); + newvals [PTSZ] = fs; newvals [SIZE] = ""; + TRY_FONT; + + newvals [PTSZ] = xflds [PTSZ]; } else newvals [SIZE] = xflds [SIZE]; TRY_FONT; |
From: Adam F. <mi...@us...> - 2001-11-10 02:07:40
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory usw-pr-cvs1:/tmp/cvs-serv24636/protocols/oscar Modified Files: aim.h auth.c oscar.c Log Message: I had to recompile zephyr AGAIN!! Index: aim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/aim.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- aim.h 2001/11/10 01:48:17 1.16 +++ aim.h 2001/11/10 02:07:37 1.17 @@ -499,7 +499,25 @@ typedef int (*aim_rxcallback_t)(aim_session_t *, aim_frame_t *, ...); -/* aim_login.c */ +struct aim_clientrelease { + char *name; + fu32_t build; + char *url; + char *info; +}; + +struct aim_authresp_info { + char *sn; + fu16_t errorcode; + char *errorurl; + fu16_t regstatus; + char *email; + char *bosip; + fu8_t *cookie; + struct aim_clientrelease latestrelease; + struct aim_clientrelease latestbeta; +}; + faim_export int aim_clientready(aim_session_t *sess, aim_conn_t *conn); faim_export int aim_sendflapver(aim_session_t *sess, aim_conn_t *conn); faim_export int aim_request_login(aim_session_t *sess, aim_conn_t *conn, const char *sn); Index: auth.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/auth.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- auth.c 2001/11/10 01:48:17 1.3 +++ auth.c 2001/11/10 02:07:37 1.4 @@ -370,15 +370,11 @@ static int parse(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_tlvlist_t *tlvlist; - int ret = 0; aim_rxcallback_t userfunc; - char *sn = NULL, *bosip = NULL, *errurl = NULL, *email = NULL; - unsigned char *cookie = NULL; - int errorcode = 0, regstatus = 0; - int latestbuild = 0, latestbetabuild = 0; - char *latestrelease = NULL, *latestbeta = NULL; - char *latestreleaseurl = NULL, *latestbetaurl = NULL; - char *latestreleaseinfo = NULL, *latestbetainfo = NULL; + struct aim_authresp_info info; + int ret = 0; + + memset(&info, 0, sizeof(info)); /* * Read block of TLVs. All further data is derived @@ -391,8 +387,8 @@ */ memset(sess->sn, 0, sizeof(sess->sn)); if (aim_gettlv(tlvlist, 0x0001, 1)) { - sn = aim_gettlv_str(tlvlist, 0x0001, 1); - strncpy(sess->sn, sn, sizeof(sess->sn)); + info.sn = aim_gettlv_str(tlvlist, 0x0001, 1); + strncpy(sess->sn, info.sn, sizeof(sess->sn)); } /* @@ -400,15 +396,15 @@ * have an error url. */ if (aim_gettlv(tlvlist, 0x0008, 1)) - errorcode = aim_gettlv16(tlvlist, 0x0008, 1); + info.errorcode = aim_gettlv16(tlvlist, 0x0008, 1); if (aim_gettlv(tlvlist, 0x0004, 1)) - errurl = aim_gettlv_str(tlvlist, 0x0004, 1); + info.errorurl = aim_gettlv_str(tlvlist, 0x0004, 1); /* * BOS server address. */ if (aim_gettlv(tlvlist, 0x0005, 1)) - bosip = aim_gettlv_str(tlvlist, 0x0005, 1); + info.bosip = aim_gettlv_str(tlvlist, 0x0005, 1); /* * Authorization cookie. @@ -418,8 +414,7 @@ tmptlv = aim_gettlv(tlvlist, 0x0006, 1); - if ((cookie = malloc(tmptlv->length))) - memcpy(cookie, tmptlv->value, tmptlv->length); + info.cookie = tmptlv->value; } /* @@ -427,7 +422,7 @@ * Not available for ICQ logins. */ if (aim_gettlv(tlvlist, 0x0011, 1)) - email = aim_gettlv_str(tlvlist, 0x0011, 1); + info.email = aim_gettlv_str(tlvlist, 0x0011, 1); /* * The registration status. (Not real sure what it means.) @@ -442,47 +437,44 @@ * */ if (aim_gettlv(tlvlist, 0x0013, 1)) - regstatus = aim_gettlv16(tlvlist, 0x0013, 1); + info.regstatus = aim_gettlv16(tlvlist, 0x0013, 1); if (aim_gettlv(tlvlist, 0x0040, 1)) - latestbetabuild = aim_gettlv32(tlvlist, 0x0040, 1); + info.latestbeta.build = aim_gettlv32(tlvlist, 0x0040, 1); if (aim_gettlv(tlvlist, 0x0041, 1)) - latestbetaurl = aim_gettlv_str(tlvlist, 0x0041, 1); + info.latestbeta.url = aim_gettlv_str(tlvlist, 0x0041, 1); if (aim_gettlv(tlvlist, 0x0042, 1)) - latestbetainfo = aim_gettlv_str(tlvlist, 0x0042, 1); + info.latestbeta.info = aim_gettlv_str(tlvlist, 0x0042, 1); if (aim_gettlv(tlvlist, 0x0043, 1)) - latestbeta = aim_gettlv_str(tlvlist, 0x0043, 1); + info.latestbeta.name = aim_gettlv_str(tlvlist, 0x0043, 1); if (aim_gettlv(tlvlist, 0x0048, 1)) ; /* no idea what this is */ if (aim_gettlv(tlvlist, 0x0044, 1)) - latestbuild = aim_gettlv32(tlvlist, 0x0044, 1); + info.latestrelease.build = aim_gettlv32(tlvlist, 0x0044, 1); if (aim_gettlv(tlvlist, 0x0045, 1)) - latestreleaseurl = aim_gettlv_str(tlvlist, 0x0045, 1); + info.latestrelease.url = aim_gettlv_str(tlvlist, 0x0045, 1); if (aim_gettlv(tlvlist, 0x0046, 1)) - latestreleaseinfo = aim_gettlv_str(tlvlist, 0x0046, 1); + info.latestrelease.info = aim_gettlv_str(tlvlist, 0x0046, 1); if (aim_gettlv(tlvlist, 0x0047, 1)) - latestrelease = aim_gettlv_str(tlvlist, 0x0047, 1); + info.latestrelease.name = aim_gettlv_str(tlvlist, 0x0047, 1); if (aim_gettlv(tlvlist, 0x0049, 1)) ; /* no idea what this is */ - if ((userfunc = aim_callhandler(sess, rx->conn, snac ? snac->family : 0x0017, snac ? snac->subtype : 0x0003))) { - /* XXX return as a struct? */ - ret = userfunc(sess, rx, sn, errorcode, errurl, regstatus, email, bosip, cookie, latestrelease, latestbuild, latestreleaseurl, latestreleaseinfo, latestbeta, latestbetabuild, latestbetaurl, latestbetainfo); - } + if ((userfunc = aim_callhandler(sess, rx->conn, snac ? snac->family : 0x0017, snac ? snac->subtype : 0x0003))) + ret = userfunc(sess, rx, &info); - free(sn); - free(bosip); - free(errurl); - free(email); - free(cookie); - free(latestrelease); - free(latestreleaseurl); - free(latestbeta); - free(latestbetaurl); - free(latestreleaseinfo); - free(latestbetainfo); + free(info.sn); + free(info.bosip); + free(info.errorurl); + free(info.email); + free(info.latestrelease.name); + free(info.latestrelease.url); + free(info.latestrelease.info); + free(info.latestbeta.name); + free(info.latestbeta.url); + free(info.latestbeta.info); aim_freetlvchain(&tlvlist); Index: oscar.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- oscar.c 2001/11/10 01:48:17 1.61 +++ oscar.c 2001/11/10 02:07:37 1.62 @@ -555,16 +555,10 @@ static int gaim_parse_auth_resp(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; - aim_conn_t *bosconn = NULL; - char *sn = NULL, *bosip = NULL, *errurl = NULL, *email = NULL; - fu8_t *cookie = NULL; - int errorcode = 0, regstatus = 0; - int latestbuild = 0, latestbetabuild = 0; - char *latestrelease = NULL, *latestbeta = NULL; - char *latestreleaseurl = NULL, *latestbetaurl = NULL; - char *latestreleaseinfo = NULL, *latestbetainfo = NULL; + struct aim_authresp_info *info; int i; char *host; int port; struct aim_user *user; + aim_conn_t *bosconn; struct gaim_connection *gc = sess->aux_data; struct oscar_data *od = gc->proto_data; @@ -573,30 +567,13 @@ atoi(user->proto_opt[USEROPT_AUTHPORT]) : FAIM_LOGIN_PORT, va_start(ap, fr); - sn = va_arg(ap, char *); - errorcode = va_arg(ap, int); - errurl = va_arg(ap, char *); - regstatus = va_arg(ap, int); - email = va_arg(ap, char *); - bosip = va_arg(ap, char *); - cookie = va_arg(ap, unsigned char *); - - latestrelease = va_arg(ap, char *); - latestbuild = va_arg(ap, int); - latestreleaseurl = va_arg(ap, char *); - latestreleaseinfo = va_arg(ap, char *); - - latestbeta = va_arg(ap, char *); - latestbetabuild = va_arg(ap, int); - latestbetaurl = va_arg(ap, char *); - latestbetainfo = va_arg(ap, char *); - + info = va_arg(ap, struct aim_authresp_info *); va_end(ap); - debug_printf("inside auth_resp (Screen name: %s)\n", sn); + debug_printf("inside auth_resp (Screen name: %s)\n", info->sn); - if (errorcode || !bosip || !cookie) { - switch (errorcode) { + if (info->errorcode || !info->bosip || !info->cookie) { + switch (info->errorcode) { case 0x05: /* Incorrect nick/password */ hide_login_progress(gc, _("Incorrect nickname or password.")); @@ -620,26 +597,20 @@ hide_login_progress(gc, _("Authentication Failed")); break; } - debug_printf("Login Error Code 0x%04x\n", errorcode); - debug_printf("Error URL: %s\n", errurl); + debug_printf("Login Error Code 0x%04x\n", info->errorcode); + debug_printf("Error URL: %s\n", info->errorurl); od->killme = TRUE; return 1; } - debug_printf("Reg status: %2d\n", regstatus); - if (email) { - debug_printf("Email: %s\n", email); + debug_printf("Reg status: %d\n", info->regstatus); + if (info->email) { + debug_printf("Email: %s\n", info->email); } else { debug_printf("Email is NULL\n"); } - debug_printf("BOSIP: %s\n", bosip); - if (latestbeta) - debug_printf("Latest WinAIM beta version %s, build %d, at %s (%s)\n", - latestbeta, latestbetabuild, latestbetaurl, latestbetainfo); - if (latestrelease) - debug_printf("Latest WinAIM released version %s, build %d, at %s (%s)\n", - latestrelease, latestbuild, latestreleaseurl, latestreleaseinfo); + debug_printf("BOSIP: %s\n", info->bosip); debug_printf("Closing auth connection...\n"); aim_conn_kill(sess, &fr->conn); @@ -676,13 +647,13 @@ aim_conn_addhandler(sess, bosconn, 0x0001, 0x000f, gaim_selfinfo, 0); ((struct oscar_data *)gc->proto_data)->conn = bosconn; - for (i = 0; i < (int)strlen(bosip); i++) { - if (bosip[i] == ':') { - port = atoi(&(bosip[i+1])); + for (i = 0; i < (int)strlen(info->bosip); i++) { + if (info->bosip[i] == ':') { + port = atoi(&(info->bosip[i+1])); break; } } - host = g_strndup(bosip, i); + host = g_strndup(info->bosip, i); bosconn->status |= AIM_CONN_STATUS_INPROGRESS; bosconn->fd = proxy_connect(host, port, oscar_bos_connect, gc); g_free(host); @@ -691,8 +662,9 @@ od->killme = TRUE; return 0; } - aim_sendcookie(sess, bosconn, cookie); + aim_sendcookie(sess, bosconn, info->cookie); gaim_input_remove(gc->inpa); + return 1; } |
From: Eric W. <war...@us...> - 2001-11-10 01:48:20
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory usw-pr-cvs1:/tmp/cvs-serv18730/protocols/oscar Modified Files: .cvsignore Makefile.am admin.c aim.h aim_internal.h auth.c bos.c conn.c im.c misc.c oscar.c Added Files: icq.c service.c Removed Files: login.c Log Message: it's not what you think --- NEW FILE: icq.c --- /* * Encapsulated ICQ. * */ #define FAIM_INTERNAL #include <aim.h> /* * Response to 15/2, contains an ICQ packet. */ static int icqresponse(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { int ret = 0; aim_rxcallback_t userfunc; if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) ret = userfunc(sess, rx); return ret; } static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { if (snac->subtype == 0x0003) return icqresponse(sess, mod, rx, snac, bs); return 0; } faim_internal int icq_modfirst(aim_session_t *sess, aim_module_t *mod) { mod->family = 0x0015; mod->version = 0x0001; mod->toolid = 0x0110; mod->toolversion = 0x047b; mod->flags = 0; strncpy(mod->name, "icq", sizeof(mod->name)); mod->snachandler = snachandler; return 0; } --- NEW FILE: service.c --- /* * Group 1. This is a very special group. All connections support * this group, as it does some particularly good things (like rate limiting). */ #define FAIM_INTERNAL #include <aim.h> #include "md5.h" /* Client Online (group 1, subtype 2) */ faim_export int aim_clientready(aim_session_t *sess, aim_conn_t *conn) { aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; struct snacgroup *sg; aim_frame_t *fr; aim_snacid_t snacid; if (!ins) return -EINVAL; if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1152))) return -ENOMEM; snacid = aim_cachesnac(sess, 0x0001, 0x0002, 0x0000, NULL, 0); aim_putsnac(&fr->data, 0x0001, 0x0002, 0x0000, snacid); /* * Send only the tool versions that the server cares about (that it * marked as supporting in the server ready SNAC). */ for (sg = ins->groups; sg; sg = sg->next) { aim_module_t *mod; if ((mod = aim__findmodulebygroup(sess, sg->group))) { aimbs_put16(&fr->data, mod->family); aimbs_put16(&fr->data, mod->version); aimbs_put16(&fr->data, mod->toolid); aimbs_put16(&fr->data, mod->toolversion); } else faimdprintf(sess, 1, "aim_clientready: server supports group 0x%04x but we don't!\n", sg->group); } aim_tx_enqueue(sess, fr); return 0; } /* * Host Online (group 1, type 3) * * See comments in conn.c about how the group associations are supposed * to work, and how they really work. * * This info probably doesn't even need to make it to the client. * * We don't actually call the client here. This starts off the connection * initialization routine required by all AIM connections. The next time * the client is called is the CONNINITDONE callback, which should be * shortly after the rate information is acknowledged. * */ static int hostonline(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { fu16_t *families; int famcount; if (!(families = malloc(aim_bstream_empty(bs)))) return 0; for (famcount = 0; aim_bstream_empty(bs); famcount++) { families[famcount] = aimbs_get16(bs); aim_conn_addgroup(rx->conn, families[famcount]); } free(families); /* * Next step is in the Host Versions handler. * * Note that we must send this before we request rates, since * the format of the rate information depends on the versions we * give it. * */ aim_setversions(sess, rx->conn); return 1; } /* Service request (group 1, type 4) */ faim_export int aim_reqservice(aim_session_t *sess, aim_conn_t *conn, fu16_t serviceid) { return aim_genericreq_s(sess, conn, 0x0001, 0x0004, &serviceid); } /* Redirect (group 1, type 5) */ static int redirect(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { int serviceid; fu8_t *cookie; char *ip; aim_rxcallback_t userfunc; aim_tlvlist_t *tlvlist; char *chathack = NULL; int chathackex = 0; int ret = 0; tlvlist = aim_readtlvchain(bs); if (!aim_gettlv(tlvlist, 0x000d, 1) || !aim_gettlv(tlvlist, 0x0005, 1) || !aim_gettlv(tlvlist, 0x0006, 1)) { aim_freetlvchain(&tlvlist); return 0; } serviceid = aim_gettlv16(tlvlist, 0x000d, 1); ip = aim_gettlv_str(tlvlist, 0x0005, 1); cookie = aim_gettlv_str(tlvlist, 0x0006, 1); /* * Chat hack. */ if ((serviceid == AIM_CONN_TYPE_CHAT) && sess->pendingjoin) { chathack = sess->pendingjoin; chathackex = sess->pendingjoinexchange; sess->pendingjoin = NULL; sess->pendingjoinexchange = 0; } if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) ret = userfunc(sess, rx, serviceid, ip, cookie, chathack, chathackex); free(ip); free(cookie); free(chathack); aim_freetlvchain(&tlvlist); return ret; } /* Request Rate Information. (group 1, type 6) */ faim_internal int aim_reqrates(aim_session_t *sess, aim_conn_t *conn) { return aim_genericreq_n(sess, conn, 0x0001, 0x0006); } /* * OSCAR defines several 'rate classes'. Each class has seperate * rate limiting properties (limit level, alert level, disconnect * level, etc), and a set of SNAC family/type pairs associated with * it. The rate classes, their limiting properties, and the definitions * of which SNACs are belong to which class, are defined in the * Rate Response packet at login to each host. * * Logically, all rate offenses within one class count against further * offenses for other SNACs in the same class (ie, sending messages * too fast will limit the number of user info requests you can send, * since those two SNACs are in the same rate class). * * Since the rate classes are defined dynamically at login, the values * below may change. But they seem to be fairly constant. * * Currently, BOS defines five rate classes, with the commonly used * members as follows... * * Rate class 0x0001: * - Everything thats not in any of the other classes * * Rate class 0x0002: * - Buddy list add/remove * - Permit list add/remove * - Deny list add/remove * * Rate class 0x0003: * - User information requests * - Outgoing ICBMs * * Rate class 0x0004: * - A few unknowns: 2/9, 2/b, and f/2 * * Rate class 0x0005: * - Chat room create * - Outgoing chat ICBMs * * The only other thing of note is that class 5 (chat) has slightly looser * limiting properties than class 3 (normal messages). But thats just a * small bit of trivia for you. * * The last thing that needs to be learned about the rate limiting * system is how the actual numbers relate to the passing of time. This * seems to be a big mystery. * */ static void rc_addclass(struct rateclass **head, struct rateclass *inrc) { struct rateclass *rc, *rc2; if (!(rc = malloc(sizeof(struct rateclass)))) return; memcpy(rc, inrc, sizeof(struct rateclass)); rc->next = NULL; for (rc2 = *head; rc2 && rc2->next; rc2 = rc2->next) ; if (!rc2) *head = rc; else rc2->next = rc; return; } static struct rateclass *rc_findclass(struct rateclass **head, fu16_t id) { struct rateclass *rc; for (rc = *head; rc; rc = rc->next) { if (rc->classid == id) return rc; } return NULL; } static void rc_addpair(struct rateclass *rc, fu16_t group, fu16_t type) { struct snacpair *sp, *sp2; if (!(sp = malloc(sizeof(struct snacpair)))) return; memset(sp, 0, sizeof(struct snacpair)); sp->group = group; sp->subtype = type; sp->next = NULL; for (sp2 = rc->members; sp2 && sp2->next; sp2 = sp2->next) ; if (!sp2) rc->members = sp; else sp2->next = sp; return; } /* Rate Parameters (group 1, type 7) */ static int rateresp(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_conn_inside_t *ins = (aim_conn_inside_t *)rx->conn->inside; fu16_t numclasses, i; aim_rxcallback_t userfunc; /* * First are the parameters for each rate class. */ numclasses = aimbs_get16(bs); for (i = 0; i < numclasses; i++) { struct rateclass rc; memset(&rc, 0, sizeof(struct rateclass)); rc.classid = aimbs_get16(bs); rc.windowsize = aimbs_get32(bs); rc.clear = aimbs_get32(bs); rc.alert = aimbs_get32(bs); rc.limit = aimbs_get32(bs); rc.disconnect = aimbs_get32(bs); rc.current = aimbs_get32(bs); rc.max = aimbs_get32(bs); /* * The server will send an extra five bytes of parameters * depending on the version we advertised in 1/17. If we * didn't send 1/17 (evil!), then this will crash and you * die, as it will default to the old version but we have * the new version hardcoded here. */ if (mod->version >= 3) aimbs_getrawbuf(bs, rc.unknown, sizeof(rc.unknown)); rc_addclass(&ins->rates, &rc); } /* * Then the members of each class. */ for (i = 0; i < numclasses; i++) { fu16_t classid, count; struct rateclass *rc; int j; classid = aimbs_get16(bs); count = aimbs_get16(bs); rc = rc_findclass(&ins->rates, classid); for (j = 0; j < count; j++) { fu16_t group, subtype; group = aimbs_get16(bs); subtype = aimbs_get16(bs); if (rc) rc_addpair(rc, group, subtype); } } /* * We don't pass the rate information up to the client, as it really * doesn't care. The information is stored in the connection, however * so that we can do more fun stuff later (not really). */ /* * Last step in the conn init procedure is to acknowledge that we * agree to these draconian limitations. */ aim_rates_addparam(sess, rx->conn); /* * Finally, tell the client it's ready to go... */ if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE))) userfunc(sess, rx); return 1; } /* Add Rate Parameter (group 1, type 8) */ faim_internal int aim_rates_addparam(aim_session_t *sess, aim_conn_t *conn) { aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; aim_frame_t *fr; aim_snacid_t snacid; struct rateclass *rc; if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 512))) return -ENOMEM; snacid = aim_cachesnac(sess, 0x0001, 0x0008, 0x0000, NULL, 0); aim_putsnac(&fr->data, 0x0001, 0x0008, 0x0000, snacid); for (rc = ins->rates; rc; rc = rc->next) aimbs_put16(&fr->data, rc->classid); aim_tx_enqueue(sess, fr); return 0; } /* Delete Rate Parameter (group 1, type 9) */ faim_internal int aim_rates_delparam(aim_session_t *sess, aim_conn_t *conn) { aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; aim_frame_t *fr; aim_snacid_t snacid; struct rateclass *rc; if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 512))) return -ENOMEM; snacid = aim_cachesnac(sess, 0x0001, 0x0009, 0x0000, NULL, 0); aim_putsnac(&fr->data, 0x0001, 0x0009, 0x0000, snacid); for (rc = ins->rates; rc; rc = rc->next) aimbs_put16(&fr->data, rc->classid); aim_tx_enqueue(sess, fr); return 0; } /* Rate Change (group 1, type 0x0a) */ static int ratechange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; fu16_t code, rateclass; fu32_t currentavg, maxavg, windowsize, clear, alert, limit, disconnect; code = aimbs_get16(bs); rateclass = aimbs_get16(bs); windowsize = aimbs_get32(bs); clear = aimbs_get32(bs); alert = aimbs_get32(bs); limit = aimbs_get32(bs); disconnect = aimbs_get32(bs); currentavg = aimbs_get32(bs); maxavg = aimbs_get32(bs); if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) return userfunc(sess, rx, code, rateclass, windowsize, clear, alert, limit, disconnect, currentavg, maxavg); return 0; } /* * How Migrations work. * * The server sends a Server Pause message, which the client should respond to * with a Server Pause Ack, which contains the families it needs on this * connection. The server will send a Migration Notice with an IP address, and * then disconnect. Next the client should open the connection and send the * cookie. Repeat the normal login process and pretend this never happened. * * The Server Pause contains no data. * */ /* Service Pause (group 1, type 0x0b) */ static int serverpause(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) return userfunc(sess, rx); return 0; } /* * Service Pause Acknowledgement (group 1, type 0x0c) * * It is rather important that aim_sendpauseack() gets called for the exact * same connection that the Server Pause callback was called for, since * libfaim extracts the data for the SNAC from the connection structure. * * Of course, if you don't do that, more bad things happen than just what * libfaim can cause. * */ faim_export int aim_sendpauseack(aim_session_t *sess, aim_conn_t *conn) { aim_frame_t *fr; aim_snacid_t snacid; aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; struct snacgroup *sg; if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1024))) return -ENOMEM; snacid = aim_cachesnac(sess, 0x0001, 0x000c, 0x0000, NULL, 0); aim_putsnac(&fr->data, 0x0001, 0x000c, 0x0000, snacid); /* * This list should have all the groups that the original * Host Online / Server Ready said this host supports. And * we want them all back after the migration. */ for (sg = ins->groups; sg; sg = sg->next) aimbs_put16(&fr->data, sg->group); aim_tx_enqueue(sess, fr); return 0; } /* Service Resume (group 1, type 0x0d) */ static int serverresume(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) return userfunc(sess, rx); return 0; } /* Request self-info (group 1, type 0x0e) */ faim_export int aim_reqpersonalinfo(aim_session_t *sess, aim_conn_t *conn) { return aim_genericreq_n(sess, conn, 0x0001, 0x000e); } /* Self User Info (group 1, type 0x0f) */ static int selfinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; aim_userinfo_t userinfo; aim_extractuserinfo(sess, bs, &userinfo); if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) return userfunc(sess, rx, &userinfo); return 0; } /* Evil Notification (group 1, type 0x10) */ static int evilnotify(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; fu16_t newevil; aim_userinfo_t userinfo; memset(&userinfo, 0, sizeof(aim_userinfo_t)); newevil = aimbs_get16(bs); if (aim_bstream_empty(bs)) aim_extractuserinfo(sess, bs, &userinfo); if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) return userfunc(sess, rx, newevil, &userinfo); return 0; } /* * Idle Notification (group 1, type 0x11) * * Should set your current idle time in seconds. Note that this should * never be called consecutively with a non-zero idle time. That makes * OSCAR do funny things. Instead, just set it once you go idle, and then * call it again with zero when you're back. * */ faim_export int aim_bos_setidle(aim_session_t *sess, aim_conn_t *conn, fu32_t idletime) { return aim_genericreq_l(sess, conn, 0x0001, 0x0011, &idletime); } /* * Service Migrate (group 1, type 0x12) * * This is the final SNAC sent on the original connection during a migration. * It contains the IP and cookie used to connect to the new server, and * optionally a list of the SNAC groups being migrated. * */ static int migrate(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; int ret = 0; fu16_t groupcount, i; aim_tlvlist_t *tl; char *ip = NULL; aim_tlv_t *cktlv; /* * Apparently there's some fun stuff that can happen right here. The * migration can actually be quite selective about what groups it * moves to the new server. When not all the groups for a connection * are migrated, or they are all migrated but some groups are moved * to a different server than others, it is called a bifurcated * migration. * * Let's play dumb and not support that. * */ groupcount = aimbs_get16(bs); for (i = 0; i < groupcount; i++) { fu16_t group; group = aimbs_get16(bs); faimdprintf(sess, 0, "bifurcated migration unsupported -- group 0x%04x\n", group); } tl = aim_readtlvchain(bs); if (aim_gettlv(tl, 0x0005, 1)) ip = aim_gettlv_str(tl, 0x0005, 1); cktlv = aim_gettlv(tl, 0x0006, 1); if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) ret = userfunc(sess, rx, ip, cktlv ? cktlv->value : NULL); aim_freetlvchain(&tl); free(ip); return ret; } /* Message of the Day (group 1, type 0x13) */ static int motd(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; char *msg = NULL; int ret = 0; aim_tlvlist_t *tlvlist; fu16_t id; /* * Code. * * Valid values: * 1 Mandatory upgrade * 2 Advisory upgrade * 3 System bulletin * 4 Nothing's wrong ("top o the world" -- normal) * 5 Lets-break-something. * */ id = aimbs_get16(bs); /* * TLVs follow */ tlvlist = aim_readtlvchain(bs); msg = aim_gettlv_str(tlvlist, 0x000b, 1); if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) ret = userfunc(sess, rx, id, msg); free(msg); aim_freetlvchain(&tlvlist); return ret; } /* * Set privacy flags (group 1, type 0x14) * * Normally 0x03. * * Bit 1: Allows other AIM users to see how long you've been idle. * Bit 2: Allows other AIM users to see how long you've been a member. * */ faim_export int aim_bos_setprivacyflags(aim_session_t *sess, aim_conn_t *conn, fu32_t flags) { return aim_genericreq_l(sess, conn, 0x0001, 0x0014, &flags); } /* * No-op (group 1, type 0x16) * * WinAIM sends these every 4min or so to keep the connection alive. Its not * real necessary. * */ faim_export int aim_nop(aim_session_t *sess, aim_conn_t *conn) { return aim_genericreq_n(sess, conn, 0x0001, 0x0016); } /* * Set client versions (group 1, subtype 0x17) * * If you've seen the clientonline/clientready SNAC you're probably * wondering what the point of this one is. And that point seems to be * that the versions in the client online SNAC are sent too late for the * server to be able to use them to change the protocol for the earlier * login packets (client versions are sent right after Host Online is * received, but client online versions aren't sent until quite a bit later). * We can see them already making use of this by changing the format of * the rate information based on what version of group 1 we advertise here. * */ faim_internal int aim_setversions(aim_session_t *sess, aim_conn_t *conn) { aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; struct snacgroup *sg; aim_frame_t *fr; aim_snacid_t snacid; if (!ins) return -EINVAL; if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1152))) return -ENOMEM; snacid = aim_cachesnac(sess, 0x0001, 0x0017, 0x0000, NULL, 0); aim_putsnac(&fr->data, 0x0001, 0x0017, 0x0000, snacid); /* * Send only the versions that the server cares about (that it * marked as supporting in the server ready SNAC). */ for (sg = ins->groups; sg; sg = sg->next) { aim_module_t *mod; if ((mod = aim__findmodulebygroup(sess, sg->group))) { aimbs_put16(&fr->data, mod->family); aimbs_put16(&fr->data, mod->version); } else faimdprintf(sess, 1, "aim_setversions: server supports group 0x%04x but we don't!\n", sg->group); } aim_tx_enqueue(sess, fr); return 0; } /* Host versions (group 1, subtype 0x18) */ static int hostversions(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { int vercount; fu8_t *versions; /* This is frivolous. (Thank you SmarterChild.) */ vercount = aim_bstream_empty(bs)/4; versions = aimbs_getraw(bs, aim_bstream_empty(bs)); free(versions); /* * Now request rates. */ aim_reqrates(sess, rx->conn); return 1; } /* * Set Extended Status (group 1, type 0x1e) * * Currently only works if using ICQ. * */ faim_export int aim_setextstatus(aim_session_t *sess, aim_conn_t *conn, fu16_t status) { aim_frame_t *fr; aim_snacid_t snacid; aim_tlvlist_t *tl = NULL; fu32_t data; data = 0x00030000 | status; /* yay for error checking ;^) */ if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 8))) return -ENOMEM; snacid = aim_cachesnac(sess, 0x0001, 0x001e, 0x0000, NULL, 0); aim_putsnac(&fr->data, 0x0001, 0x001e, 0x0000, snacid); aim_addtlvtochain32(&tl, 0x0006, data); aim_writetlvchain(&fr->data, &tl); aim_freetlvchain(&tl); aim_tx_enqueue(sess, fr); return 0; } /* * Starting this past week (26 Mar 2001, say), AOL has started sending * this nice little extra SNAC. AFAIK, it has never been used until now. * * The request contains eight bytes. The first four are an offset, the * second four are a length. * * The offset is an offset into aim.exe when it is mapped during execution * on Win32. So far, AOL has only been requesting bytes in static regions * of memory. (I won't put it past them to start requesting data in * less static regions -- regions that are initialized at run time, but still * before the client recieves this request.) * * When the client recieves the request, it adds it to the current ds * (0x00400000) and dereferences it, copying the data into a buffer which * it then runs directly through the MD5 hasher. The 16 byte output of * the hash is then sent back to the server. * * If the client does not send any data back, or the data does not match * the data that the specific client should have, the client will get the * following message from "AOL Instant Messenger": * "You have been disconnected from the AOL Instant Message Service (SM) * for accessing the AOL network using unauthorized software. You can * download a FREE, fully featured, and authorized client, here * http://www.aol.com/aim/download2.html" * The connection is then closed, recieving disconnect code 1, URL * http://www.aim.aol.com/errors/USER_LOGGED_OFF_NEW_LOGIN.html. * * Note, however, that numerous inconsistencies can cause the above error, * not just sending back a bad hash. Do not immediatly suspect this code * if you get disconnected. AOL and the open/free software community have * played this game for a couple years now, generating the above message * on numerous ocassions. * * Anyway, neener. We win again. * */ /* Client verification (group 1, subtype 0x1f) */ static int memrequest(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; fu32_t offset, len; aim_tlvlist_t *list; char *modname; offset = aimbs_get32(bs); len = aimbs_get32(bs); list = aim_readtlvchain(bs); modname = aim_gettlv_str(list, 0x0001, 1); faimdprintf(sess, 1, "data at 0x%08lx (%d bytes) of requested\n", offset, len, modname ? modname : "aim.exe"); if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) return userfunc(sess, rx, offset, len, modname); free(modname); aim_freetlvchain(&list); return 0; } #if 0 static void dumpbox(aim_session_t *sess, unsigned char *buf, int len) { int i; if (!sess || !buf || !len) return; faimdprintf(sess, 1, "\nDump of %d bytes at %p:", len, buf); for (i = 0; i < len; i++) { if ((i % 8) == 0) faimdprintf(sess, 1, "\n\t"); faimdprintf(sess, 1, "0x%2x ", buf[i]); } faimdprintf(sess, 1, "\n\n"); return; } #endif /* Client verification reply (group 1, subtype 0x20) */ faim_export int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, fu32_t offset, fu32_t len, const fu8_t *buf, fu8_t flag) { aim_frame_t *fr; aim_snacid_t snacid; if (!sess || !conn) return -EINVAL; if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2+16))) return -ENOMEM; snacid = aim_cachesnac(sess, 0x0001, 0x0020, 0x0000, NULL, 0); aim_putsnac(&fr->data, 0x0001, 0x0020, 0x0000, snacid); aimbs_put16(&fr->data, 0x0010); /* md5 is always 16 bytes */ if ((flag == AIM_SENDMEMBLOCK_FLAG_ISHASH) && buf && (len == 0x10)) { /* we're getting a hash */ aimbs_putraw(&fr->data, buf, 0x10); } else if (buf && (len > 0)) { /* use input buffer */ md5_state_t state; md5_byte_t digest[0x10]; md5_init(&state); md5_append(&state, (const md5_byte_t *)buf, len); md5_finish(&state, digest); aimbs_putraw(&fr->data, (fu8_t *)digest, 0x10); } else if (len == 0) { /* no length, just hash NULL (buf is optional) */ md5_state_t state; fu8_t nil = '\0'; md5_byte_t digest[0x10]; /* * These MD5 routines are stupid in that you have to have * at least one append. So thats why this doesn't look * real logical. */ md5_init(&state); md5_append(&state, (const md5_byte_t *)&nil, 0); md5_finish(&state, digest); aimbs_putraw(&fr->data, (fu8_t *)digest, 0x10); } else { /* * This data is correct for AIM 3.5.1670. * * Using these blocks is as close to "legal" as you can get * without using an AIM binary. * */ if ((offset == 0x03ffffff) && (len == 0x03ffffff)) { #if 1 /* with "AnrbnrAqhfzcd" */ aimbs_put32(&fr->data, 0x44a95d26); aimbs_put32(&fr->data, 0xd2490423); aimbs_put32(&fr->data, 0x93b8821f); aimbs_put32(&fr->data, 0x51c54b01); #else /* no filename */ aimbs_put32(&fr->data, 0x1df8cbae); aimbs_put32(&fr->data, 0x5523b839); aimbs_put32(&fr->data, 0xa0e10db3); aimbs_put32(&fr->data, 0xa46d3b39); #endif } else if ((offset == 0x00001000) && (len == 0x00000000)) { aimbs_put32(&fr->data, 0xd41d8cd9); aimbs_put32(&fr->data, 0x8f00b204); aimbs_put32(&fr->data, 0xe9800998); aimbs_put32(&fr->data, 0xecf8427e); } else faimdprintf(sess, 0, "sendmemblock: WARNING: unknown hash request\n"); } aim_tx_enqueue(sess, fr); return 0; } static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { if (snac->subtype == 0x0003) return hostonline(sess, mod, rx, snac, bs); else if (snac->subtype == 0x0005) return redirect(sess, mod, rx, snac, bs); else if (snac->subtype == 0x0007) return rateresp(sess, mod, rx, snac, bs); else if (snac->subtype == 0x000a) return ratechange(sess, mod, rx, snac, bs); else if (snac->subtype == 0x000b) return serverpause(sess, mod, rx, snac, bs); else if (snac->subtype == 0x000d) return serverresume(sess, mod, rx, snac, bs); else if (snac->subtype == 0x000f) return selfinfo(sess, mod, rx, snac, bs); else if (snac->subtype == 0x0010) return evilnotify(sess, mod, rx, snac, bs); else if (snac->subtype == 0x0012) return migrate(sess, mod, rx, snac, bs); else if (snac->subtype == 0x0013) return motd(sess, mod, rx, snac, bs); else if (snac->subtype == 0x0018) return hostversions(sess, mod, rx, snac, bs); else if (snac->subtype == 0x001f) return memrequest(sess, mod, rx, snac, bs); return 0; } faim_internal int general_modfirst(aim_session_t *sess, aim_module_t *mod) { mod->family = 0x0001; mod->version = 0x0003; mod->toolid = 0x0110; mod->toolversion = 0x047b; mod->flags = 0; strncpy(mod->name, "general", sizeof(mod->name)); mod->snachandler = snachandler; return 0; } Index: .cvsignore =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .cvsignore 2001/11/05 20:51:12 1.2 +++ .cvsignore 2001/11/10 01:48:16 1.3 @@ -32,3 +32,5 @@ popups.lo ssi.lo translate.lo +icq.lo +service.lo Index: Makefile.am =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 2001/11/05 02:05:06 1.5 +++ Makefile.am 2001/11/10 01:48:17 1.6 @@ -21,10 +21,10 @@ chatnav.c \ conn.c \ ft.c \ + icq.c \ im.c \ info.c \ invite.c \ - login.c \ md5.c \ meta.c \ misc.c \ @@ -33,6 +33,7 @@ rxhandlers.c \ rxqueue.c \ search.c \ + service.c \ snac.c \ ssi.c \ stats.c \ @@ -58,10 +59,10 @@ chatnav.c \ conn.c \ ft.c \ + icq.c \ im.c \ info.c \ invite.c \ - login.c \ md5.c \ meta.c \ misc.c \ @@ -70,6 +71,7 @@ rxhandlers.c \ rxqueue.c \ search.c \ + service.c \ snac.c \ ssi.c \ stats.c \ Index: admin.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/admin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- admin.c 2001/11/05 02:05:06 1.3 +++ admin.c 2001/11/10 01:48:17 1.4 @@ -87,7 +87,7 @@ return 0; } -faim_export int aim_auth_changepasswd(aim_session_t *sess, aim_conn_t *conn, const char *newpw, const char *curpw) +faim_export int aim_admin_changepasswd(aim_session_t *sess, aim_conn_t *conn, const char *newpw, const char *curpw) { aim_frame_t *tx; aim_tlvlist_t *tl = NULL; @@ -121,7 +121,7 @@ * get the TRIAL flag removed from your account. * */ -faim_export int aim_auth_reqconfirm(aim_session_t *sess, aim_conn_t *conn) +faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn) { return aim_genericreq_n(sess, conn, 0x0007, 0x0006); } @@ -132,7 +132,7 @@ * The only known valid tag is 0x0011 (email address). * */ -faim_export int aim_auth_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info) +faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info) { aim_frame_t *tx; aim_snacid_t snacid; @@ -151,7 +151,7 @@ return 0; } -faim_export int aim_auth_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail) +faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail) { aim_frame_t *tx; aim_snacid_t snacid; @@ -172,3 +172,4 @@ return 0; } + Index: aim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/aim.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- aim.h 2001/11/05 12:25:22 1.15 +++ aim.h 2001/11/10 01:48:17 1.16 @@ -505,10 +505,6 @@ faim_export int aim_request_login(aim_session_t *sess, aim_conn_t *conn, const char *sn); faim_export int aim_send_login(aim_session_t *, aim_conn_t *, const char *, const char *, struct client_info_s *, const char *key); faim_export int aim_encode_password_md5(const char *password, const char *key, unsigned char *digest); -faim_export int aim_sendauthresp(aim_session_t *sess, aim_conn_t *conn, const char *sn, int errorcode, const char *errorurl, const char *bosip, const char *cookie, const char *email, int regstatus); -faim_export int aim_gencookie(unsigned char *buf); -faim_export int aim_sendserverready(aim_session_t *sess, aim_conn_t *conn); -faim_export int aim_sendredirect(aim_session_t *sess, aim_conn_t *conn, fu16_t servid, const char *ip, const char *cookie); faim_export void aim_purge_rxqueue(aim_session_t *); #define AIM_TX_QUEUED 0 /* default */ @@ -558,7 +554,7 @@ faim_export int aim_sendpauseack(aim_session_t *sess, aim_conn_t *conn); faim_export int aim_send_warning(aim_session_t *sess, aim_conn_t *conn, const char *destsn, fu32_t flags); -faim_export int aim_bos_nop(aim_session_t *, aim_conn_t *); +faim_export int aim_nop(aim_session_t *, aim_conn_t *); faim_export int aim_flap_nop(aim_session_t *sess, aim_conn_t *conn); faim_export int aim_bos_setidle(aim_session_t *, aim_conn_t *, fu32_t); faim_export int aim_bos_changevisibility(aim_session_t *, aim_conn_t *, int, const char *); @@ -566,14 +562,14 @@ faim_export int aim_bos_setprofile(aim_session_t *sess, aim_conn_t *conn, const char *profile, const char *awaymsg, fu16_t caps); faim_export int aim_bos_setgroupperm(aim_session_t *, aim_conn_t *, fu32_t mask); faim_export int aim_bos_setprivacyflags(aim_session_t *, aim_conn_t *, fu32_t); -faim_export int aim_bos_reqpersonalinfo(aim_session_t *, aim_conn_t *); -faim_export int aim_bos_reqservice(aim_session_t *, aim_conn_t *, fu16_t); +faim_export int aim_reqpersonalinfo(aim_session_t *, aim_conn_t *); +faim_export int aim_reqservice(aim_session_t *, aim_conn_t *, fu16_t); faim_export int aim_bos_reqrights(aim_session_t *, aim_conn_t *); faim_export int aim_bos_reqbuddyrights(aim_session_t *, aim_conn_t *); faim_export int aim_bos_reqlocaterights(aim_session_t *, aim_conn_t *); faim_export int aim_setdirectoryinfo(aim_session_t *sess, aim_conn_t *conn, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy); faim_export int aim_setuserinterests(aim_session_t *sess, aim_conn_t *conn, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, fu16_t privacy); -faim_export int aim_icq_setstatus(aim_session_t *sess, aim_conn_t *conn, fu16_t status); +faim_export int aim_setextstatus(aim_session_t *sess, aim_conn_t *conn, fu16_t status); faim_export struct aim_fileheader_t *aim_getlisting(aim_session_t *sess, FILE *); @@ -652,6 +648,7 @@ #define AIM_IMFLAGS_EXTDATA 0x0100 #define AIM_IMFLAGS_CUSTOMCHARSET 0x0200 /* charset fields set */ #define AIM_IMFLAGS_MULTIPART 0x0400 /* ->mpmsg section valid */ +#define AIM_IMFLAGS_OFFLINE 0x0800 /* send to offline user */ /* * Multipart message structures. @@ -890,12 +887,12 @@ /* auth.c */ -faim_export int aim_auth_sendcookie(aim_session_t *, aim_conn_t *, const fu8_t *); +faim_export int aim_sendcookie(aim_session_t *, aim_conn_t *, const fu8_t *); -faim_export int aim_auth_changepasswd(aim_session_t *, aim_conn_t *, const char *newpw, const char *curpw); -faim_export int aim_auth_reqconfirm(aim_session_t *sess, aim_conn_t *conn); -faim_export int aim_auth_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info); -faim_export int aim_auth_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail); +faim_export int aim_admin_changepasswd(aim_session_t *, aim_conn_t *, const char *newpw, const char *curpw); +faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn); +faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info); +faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail); /* aim_buddylist.c */ faim_export int aim_add_buddy(aim_session_t *, aim_conn_t *, const char *); Index: aim_internal.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/aim_internal.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- aim_internal.h 2001/11/05 12:25:22 1.6 +++ aim_internal.h 2001/11/10 01:48:17 1.7 @@ -51,6 +51,7 @@ faim_internal int translate_modfirst(aim_session_t *sess, aim_module_t *mod); faim_internal int popups_modfirst(aim_session_t *sess, aim_module_t *mod); faim_internal int adverts_modfirst(aim_session_t *sess, aim_module_t *mod); +faim_internal int icq_modfirst(aim_session_t *sess, aim_module_t *mod); faim_internal int aim_genericreq_n(aim_session_t *, aim_conn_t *conn, fu16_t family, fu16_t subtype); faim_internal int aim_genericreq_n_snacid(aim_session_t *, aim_conn_t *conn, fu16_t family, fu16_t subtype); @@ -202,7 +203,8 @@ /* These are all handled internally now. */ faim_internal int aim_setversions(aim_session_t *sess, aim_conn_t *conn); faim_internal int aim_reqrates(aim_session_t *, aim_conn_t *); -faim_internal int aim_ratesack(aim_session_t *, aim_conn_t *); +faim_internal int aim_rates_addparam(aim_session_t *, aim_conn_t *); +faim_internal int aim_rates_delparam(aim_session_t *, aim_conn_t *); #ifndef FAIM_INTERNAL_INSANE #define printf() printf called inside libfaim Index: auth.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/auth.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- auth.c 2001/09/09 10:07:13 1.2 +++ auth.c 2001/11/10 01:48:17 1.3 @@ -1,15 +1,24 @@ /* - * aim_auth.c - * - * Deals with the authorizer. + * Deals with the authorizer (group 0x0017=23, and old-style non-SNAC login). * */ #define FAIM_INTERNAL #include <aim.h> -/* this just pushes the passed cookie onto the passed connection -- NO SNAC! */ -faim_export int aim_auth_sendcookie(aim_session_t *sess, aim_conn_t *conn, const fu8_t *chipsahoy) +#include "md5.h" + +static int aim_encode_password(const char *password, unsigned char *encoded); + +/* + * This just pushes the passed cookie onto the passed connection, without + * the SNAC header or any of that. + * + * Very commonly used, as every connection except auth will require this to + * be the first thing you send. + * + */ +faim_export int aim_sendcookie(aim_session_t *sess, aim_conn_t *conn, const fu8_t *chipsahoy) { aim_frame_t *fr; aim_tlvlist_t *tl = NULL; @@ -23,6 +32,328 @@ aim_freetlvchain(&tl); aim_tx_enqueue(sess, fr); + + return 0; +} + +/* + * Normally the FLAP version is sent as the first few bytes of the cookie, + * meaning you generally never call this. + * + * But there are times when something might want it seperate. Specifically, + * libfaim sends this internally when doing SNAC login. + * + */ +faim_export int aim_sendflapver(aim_session_t *sess, aim_conn_t *conn) +{ + aim_frame_t *fr; + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x01, 4))) + return -ENOMEM; + + aimbs_put32(&fr->data, 0x00000001); + + aim_tx_enqueue(sess, fr); + + return 0; +} + +/* + * This is a bit confusing. + * + * Normal SNAC login goes like this: + * - connect + * - server sends flap version + * - client sends flap version + * - client sends screen name (17/6) + * - server sends hash key (17/7) + * - client sends auth request (17/2 -- aim_send_login) + * - server yells + * + * XOR login (for ICQ) goes like this: + * - connect + * - server sends flap version + * - client sends auth request which contains flap version (aim_send_login) + * - server yells + * + * For the client API, we make them implement the most complicated version, + * and for the simpler version, we fake it and make it look like the more + * complicated process. + * + * This is done by giving the client a faked key, just so we can convince + * them to call aim_send_login right away, which will detect the session + * flag that says this is XOR login and ignore the key, sending an ICQ + * login request instead of the normal SNAC one. + * + * As soon as AOL makes ICQ log in the same way as AIM, this is /gone/. + * + * XXX This may cause problems if the client relies on callbacks only + * being called from the context of aim_rxdispatch()... + * + */ +static int goddamnicq(aim_session_t *sess, aim_conn_t *conn, const char *sn) +{ + aim_frame_t fr; + aim_rxcallback_t userfunc; + + sess->flags &= ~AIM_SESS_FLAGS_SNACLOGIN; + sess->flags |= AIM_SESS_FLAGS_XORLOGIN; + + fr.conn = conn; + + if ((userfunc = aim_callhandler(sess, conn, 0x0017, 0x0007))) + userfunc(sess, &fr, ""); + + return 0; +} + +/* + * In AIM 3.5 protocol, the first stage of login is to request login from the + * Authorizer, passing it the screen name for verification. If the name is + * invalid, a 0017/0003 is spit back, with the standard error contents. If + * valid, a 0017/0007 comes back, which is the signal to send it the main + * login command (0017/0002). + * + */ +faim_export int aim_request_login(aim_session_t *sess, aim_conn_t *conn, const char *sn) +{ + aim_frame_t *fr; + aim_snacid_t snacid; + aim_tlvlist_t *tl = NULL; + + if (!sess || !conn || !sn) + return -EINVAL; + + if ((sn[0] >= '0') && (sn[0] <= '9')) + return goddamnicq(sess, conn, sn); + + sess->flags |= AIM_SESS_FLAGS_SNACLOGIN; + + aim_sendflapver(sess, conn); + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2+2+strlen(sn)))) + return -ENOMEM; + + snacid = aim_cachesnac(sess, 0x0017, 0x0006, 0x0000, NULL, 0); + aim_putsnac(&fr->data, 0x0017, 0x0006, 0x0000, snacid); + + aim_addtlvtochain_raw(&tl, 0x0001, strlen(sn), sn); + aim_writetlvchain(&fr->data, &tl); + aim_freetlvchain(&tl); + + aim_tx_enqueue(sess, fr); + + return 0; +} + +/* + * Part two of the ICQ hack. Note the ignoring of the key and clientinfo. + */ +static int goddamnicq2(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *password) +{ + static const char clientstr[] = {"ICQ Inc. - Product of ICQ (TM) 2000b.4.65.1.3281.85"}; + static const char lang[] = {"en"}; + static const char country[] = {"us"}; + aim_frame_t *fr; + aim_tlvlist_t *tl = NULL; + char *password_encoded; + + if (!(password_encoded = (char *) malloc(strlen(password)))) + return -ENOMEM; + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x01, 1152))) { + free(password_encoded); + return -ENOMEM; + } + + aim_encode_password(password, password_encoded); + + aimbs_put32(&fr->data, 0x00000001); + aim_addtlvtochain_raw(&tl, 0x0001, strlen(sn), sn); + aim_addtlvtochain_raw(&tl, 0x0002, strlen(password), password_encoded); + aim_addtlvtochain_raw(&tl, 0x0003, strlen(clientstr), clientstr); + aim_addtlvtochain16(&tl, 0x0016, 0x010a); + aim_addtlvtochain16(&tl, 0x0017, 0x0004); + aim_addtlvtochain16(&tl, 0x0018, 0x0041); + aim_addtlvtochain16(&tl, 0x0019, 0x0001); + aim_addtlvtochain16(&tl, 0x001a, 0x0cd1); + aim_addtlvtochain32(&tl, 0x0014, 0x00000055); + aim_addtlvtochain_raw(&tl, 0x000f, strlen(lang), lang); + aim_addtlvtochain_raw(&tl, 0x000e, strlen(country), country); + + aim_writetlvchain(&fr->data, &tl); + + free(password_encoded); + aim_freetlvchain(&tl); + + aim_tx_enqueue(sess, fr); + + return 0; +} + +/* + * send_login(int socket, char *sn, char *password) + * + * This is the initial login request packet. + * + * NOTE!! If you want/need to make use of the aim_sendmemblock() function, + * then the client information you send here must exactly match the + * executable that you're pulling the data from. + * + * Latest WinAIM: + * clientstring = "AOL Instant Messenger (SM), version 4.3.2188/WIN32" + * major2 = 0x0109 + * major = 0x0400 + * minor = 0x0003 + * minor2 = 0x0000 + * build = 0x088c + * unknown = 0x00000086 + * lang = "en" + * country = "us" + * unknown4a = 0x01 + * + * Latest WinAIM that libfaim can emulate without server-side buddylists: + * clientstring = "AOL Instant Messenger (SM), version 4.1.2010/WIN32" + * major2 = 0x0004 + * major = 0x0004 + * minor = 0x0001 + * minor2 = 0x0000 + * build = 0x07da + * unknown= 0x0000004b + * + * WinAIM 3.5.1670: + * clientstring = "AOL Instant Messenger (SM), version 3.5.1670/WIN32" + * major2 = 0x0004 + * major = 0x0003 + * minor = 0x0005 + * minor2 = 0x0000 + * build = 0x0686 + * unknown =0x0000002a + * + * Java AIM 1.1.19: + * clientstring = "AOL Instant Messenger (TM) version 1.1.19 for Java built 03/24/98, freeMem 215871 totalMem 1048567, i686, Linus, #2 SMP Sun Feb 11 03:41:17 UTC 2001 2.4.1-ac9, IBM Corporation, 1.1.8, 45.3, Tue Mar 27 12:09:17 PST 2001" + * major2 = 0x0001 + * major = 0x0001 + * minor = 0x0001 + * minor2 = (not sent) + * build = 0x0013 + * unknown= (not sent) + * + * AIM for Linux 1.1.112: + * clientstring = "AOL Instant Messenger (SM)" + * major2 = 0x1d09 + * major = 0x0001 + * minor = 0x0001 + * minor2 = 0x0001 + * build = 0x0070 + * unknown= 0x0000008b + * serverstore = 0x01 + * + */ +faim_export int aim_send_login(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *password, struct client_info_s *clientinfo, const char *key) +{ + aim_frame_t *fr; + aim_tlvlist_t *tl = NULL; + fu8_t digest[16]; + aim_snacid_t snacid; + + if (!clientinfo || !sn || !password) + return -EINVAL; + + if (sess->flags & AIM_SESS_FLAGS_XORLOGIN) + return goddamnicq2(sess, conn, sn, password); + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1152))) + return -ENOMEM; + + if (sess->flags & AIM_SESS_FLAGS_XORLOGIN) { + fr->hdr.flap.type = 0x01; + + /* Use very specific version numbers to further indicate hack */ + clientinfo->major2 = 0x010a; + clientinfo->major = 0x0004; + clientinfo->minor = 0x003c; + clientinfo->minor2 = 0x0001; + clientinfo->build = 0x0cce; + clientinfo->unknown = 0x00000055; + } + + snacid = aim_cachesnac(sess, 0x0017, 0x0002, 0x0000, NULL, 0); + aim_putsnac(&fr->data, 0x0017, 0x0002, 0x0000, snacid); + + aim_addtlvtochain_raw(&tl, 0x0001, strlen(sn), sn); + + aim_encode_password_md5(password, key, digest); + aim_addtlvtochain_raw(&tl, 0x0025, 16, digest); + + aim_addtlvtochain_raw(&tl, 0x0003, strlen(clientinfo->clientstring), clientinfo->clientstring); + aim_addtlvtochain16(&tl, 0x0016, (fu16_t)clientinfo->major2); + aim_addtlvtochain16(&tl, 0x0017, (fu16_t)clientinfo->major); + aim_addtlvtochain16(&tl, 0x0018, (fu16_t)clientinfo->minor); + aim_addtlvtochain16(&tl, 0x0019, (fu16_t)clientinfo->minor2); + aim_addtlvtochain16(&tl, 0x001a, (fu16_t)clientinfo->build); + aim_addtlvtochain_raw(&tl, 0x000e, strlen(clientinfo->country), clientinfo->country); + aim_addtlvtochain_raw(&tl, 0x000f, strlen(clientinfo->lang), clientinfo->lang); + aim_addtlvtochain16(&tl, 0x0009, 0x0015); + + aim_writetlvchain(&fr->data, &tl); + + aim_freetlvchain(&tl); + + aim_tx_enqueue(sess, fr); + + return 0; +} + +faim_export int aim_encode_password_md5(const char *password, const char *key, fu8_t *digest) +{ + md5_state_t state; + + md5_init(&state); + md5_append(&state, (const md5_byte_t *)key, strlen(key)); + md5_append(&state, (const md5_byte_t *)password, strlen(password)); + md5_append(&state, (const md5_byte_t *)AIM_MD5_STRING, strlen(AIM_MD5_STRING)); + md5_finish(&state, (md5_byte_t *)digest); + + return 0; +} + +/** + * aim_encode_password - Encode a password using old XOR method + * @password: incoming password + * @encoded: buffer to put encoded password + * + * This takes a const pointer to a (null terminated) string + * containing the unencoded password. It also gets passed + * an already allocated buffer to store the encoded password. + * This buffer should be the exact length of the password without + * the null. The encoded password buffer /is not %NULL terminated/. + * + * The encoding_table seems to be a fixed set of values. We'll + * hope it doesn't change over time! + * + * This is only used for the XOR method, not the better MD5 method. + * + */ +static int aim_encode_password(const char *password, fu8_t *encoded) +{ + fu8_t encoding_table[] = { +#if 0 /* old v1 table */ + 0xf3, 0xb3, 0x6c, 0x99, + 0x95, 0x3f, 0xac, 0xb6, + 0xc5, 0xfa, 0x6b, 0x63, + 0x69, 0x6c, 0xc3, 0x9f +#else /* v2.1 table, also works for ICQ */ + 0xf3, 0x26, 0x81, 0xc4, + 0x39, 0x86, 0xdb, 0x92, + 0x71, 0xa3, 0xb9, 0xe6, + 0x53, 0x7a, 0x95, 0x7c +#endif + }; + int i; + + for (i = 0; i < strlen(password); i++) + encoded[i] = (password[i] ^ encoding_table[i]); return 0; } Index: bos.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/bos.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- bos.c 2001/11/05 02:05:06 1.3 +++ bos.c 2001/11/10 01:48:17 1.4 @@ -2,21 +2,13 @@ #define FAIM_INTERNAL #include <aim.h> -/* - * aim_bos_setgroupperm(mask) - * - * Set group permisson mask. Normally 0x1f (all classes). - * - * The group permission mask allows you to keep users of a certain - * class or classes from talking to you. The mask should be - * a bitwise OR of all the user classes you want to see you. - * - */ -faim_export int aim_bos_setgroupperm(aim_session_t *sess, aim_conn_t *conn, fu32_t mask) +/* Request BOS rights (group 9, type 2) */ +faim_export int aim_bos_reqrights(aim_session_t *sess, aim_conn_t *conn) { - return aim_genericreq_l(sess, conn, 0x0009, 0x0004, &mask); + return aim_genericreq_n(sess, conn, 0x0009, 0x0002); } +/* BOS Rights (group 9, type 3) */ static int rights(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { aim_rxcallback_t userfunc; @@ -47,6 +39,101 @@ aim_freetlvchain(&tlvlist); return ret; +} + +/* + * Set group permisson mask (group 9, type 4) + * + * Normally 0x1f (all classes). + * + * The group permission mask allows you to keep users of a certain + * class or classes from talking to you. The mask should be + * a bitwise OR of all the user classes you want to see you. + * + */ +faim_export int aim_bos_setgroupperm(aim_session_t *sess, aim_conn_t *conn, fu32_t mask) +{ + return aim_genericreq_l(sess, conn, 0x0009, 0x0004, &mask); +} + +/* + * Modify permit/deny lists (group 9, types 5, 6, 7, and 8) + * + * Changes your visibility depending on changetype: + * + * AIM_VISIBILITYCHANGE_PERMITADD: Lets provided list of names see you + * AIM_VISIBILITYCHANGE_PERMIDREMOVE: Removes listed names from permit list + * AIM_VISIBILITYCHANGE_DENYADD: Hides you from provided list of names + * AIM_VISIBILITYCHANGE_DENYREMOVE: Lets list see you again + * + * list should be a list of + * screen names in the form "Screen Name One&ScreenNameTwo&" etc. + * + * Equivelents to options in WinAIM: + * - Allow all users to contact me: Send an AIM_VISIBILITYCHANGE_DENYADD + * with only your name on it. + * - Allow only users on my Buddy List: Send an + * AIM_VISIBILITYCHANGE_PERMITADD with the list the same as your + * buddy list + * - Allow only the uesrs below: Send an AIM_VISIBILITYCHANGE_PERMITADD + * with everyone listed that you want to see you. + * - Block all users: Send an AIM_VISIBILITYCHANGE_PERMITADD with only + * yourself in the list + * - Block the users below: Send an AIM_VISIBILITYCHANGE_DENYADD with + * the list of users to be blocked + * + * XXX ye gods. + */ +faim_export int aim_bos_changevisibility(aim_session_t *sess, aim_conn_t *conn, int changetype, const char *denylist) +{ + aim_frame_t *fr; + int packlen = 0; + fu16_t subtype; + char *localcpy = NULL, *tmpptr = NULL; + int i; + int listcount; + aim_snacid_t snacid; + + if (!denylist) + return -EINVAL; + + if (changetype == AIM_VISIBILITYCHANGE_PERMITADD) + subtype = 0x05; + else if (changetype == AIM_VISIBILITYCHANGE_PERMITREMOVE) + subtype = 0x06; + else if (changetype == AIM_VISIBILITYCHANGE_DENYADD) + subtype = 0x07; + else if (changetype == AIM_VISIBILITYCHANGE_DENYREMOVE) + subtype = 0x08; + else + return -EINVAL; + + localcpy = strdup(denylist); + + listcount = aimutil_itemcnt(localcpy, '&'); + packlen = aimutil_tokslen(localcpy, 99, '&') + listcount + 9; + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, packlen))) { + free(localcpy); + return -ENOMEM; + } + + snacid = aim_cachesnac(sess, 0x0009, subtype, 0x0000, NULL, 0); + aim_putsnac(&fr->data, 0x0009, subtype, 0x00, snacid); + + for (i = 0; (i < (listcount - 1)) && (i < 99); i++) { + tmpptr = aimutil_itemidx(localcpy, i, '&'); + + aimbs_put8(&fr->data, strlen(tmpptr)); + aimbs_putraw(&fr->data, tmpptr, strlen(tmpptr)); + + free(tmpptr); + } + free(localcpy); + + aim_tx_enqueue(sess, fr); + + return 0; } static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) Index: conn.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/conn.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- conn.c 2001/11/05 12:25:22 1.6 +++ conn.c 2001/11/10 01:48:17 1.7 @@ -899,7 +899,9 @@ aim__registermodule(sess, chat_modfirst); /* missing 0x0f - 0x12 */ aim__registermodule(sess, ssi_modfirst); - /* missing 0x14 - 0x16 */ + /* missing 0x14 */ + aim__registermodule(sess, icq_modfirst); + /* missing 0x16 */ aim__registermodule(sess, auth_modfirst); return; @@ -1042,4 +1044,23 @@ return 0; } + +/* + * aim_flap_nop() + * + * No-op. WinAIM 4.x sends these _every minute_ to keep + * the connection alive. + */ +faim_export int aim_flap_nop(aim_session_t *sess, aim_conn_t *conn) +{ + aim_frame_t *fr; + + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x05, 0))) + return -ENOMEM; + + aim_tx_enqueue(sess, fr); + + return 0; +} + Index: im.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/im.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- im.c 2001/11/05 08:25:10 1.14 +++ im.c 2001/11/10 01:48:17 1.15 @@ -107,6 +107,8 @@ * AIM_IMFLAGS_AWAY -- Marks the message as an autoresponse * AIM_IMFLAGS_ACK -- Requests that the server send an ack * when the message is received (of type 0x0004/0x000c) + * AIM_IMFLAGS_OFFLINE--If destination is offline, store it until they are + * online (probably ICQ only). * AIM_IMFLAGS_UNICODE--Instead of ASCII7, the passed message is * made up of UNICODE duples. If you set * this, you'd better be damn sure you know @@ -305,11 +307,8 @@ aimbs_put16(&fr->data, 0x0000); } - /* - * Set the Buddy Icon Requested flag. - */ - if (args->flags & AIM_IMFLAGS_BUDDYREQ) { - aimbs_put16(&fr->data, 0x0009); + if (args->flags & AIM_IMFLAGS_OFFLINE) { + aimbs_put16(&fr->data, 0x0006); aimbs_put16(&fr->data, 0x0000); } @@ -325,6 +324,14 @@ aimbs_put32(&fr->data, args->iconstamp); } + /* + * Set the Buddy Icon Requested flag. + */ + if (args->flags & AIM_IMFLAGS_BUDDYREQ) { + aimbs_put16(&fr->data, 0x0009); + aimbs_put16(&fr->data, 0x0000); + } + aim_tx_enqueue(sess, fr); #if 1 /* XXX do this with autoconf or something... */ @@ -860,6 +867,11 @@ } else if (type == 0x0004) { /* Message is Auto Response */ args.icbmflags |= AIM_IMFLAGS_AWAY; + + } else if (type == 0x0006) { /* Message was received offline. */ + + /* XXX not sure if this actually gets sent. */ + args.icbmflags |= AIM_IMFLAGS_OFFLINE; } else if (type == 0x0008) { /* I-HAVE-A-REALLY-PURTY-ICON Flag */ Index: misc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/misc.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- misc.c 2001/11/05 12:25:22 1.8 +++ misc.c 2001/11/10 01:48:17 1.9 @@ -15,102 +15,6 @@ #include <aim.h> /* - * aim_bos_setidle() - * - * Should set your current idle time in seconds. Idealy, OSCAR should - * do this for us. But, it doesn't. The client must call this to set idle - * time. - * - */ -faim_export int aim_bos_setidle(aim_session_t *sess, aim_conn_t *conn, fu32_t idletime) -{ - return aim_genericreq_l(sess, conn, 0x0001, 0x0011, &idletime); -} - - -/* - * aim_bos_changevisibility(conn, changtype, namelist) - * - * Changes your visibility depending on changetype: - * - * AIM_VISIBILITYCHANGE_PERMITADD: Lets provided list of names see you - * AIM_VISIBILITYCHANGE_PERMIDREMOVE: Removes listed names from permit list - * AIM_VISIBILITYCHANGE_DENYADD: Hides you from provided list of names - * AIM_VISIBILITYCHANGE_DENYREMOVE: Lets list see you again - * - * list should be a list of - * screen names in the form "Screen Name One&ScreenNameTwo&" etc. - * - * Equivelents to options in WinAIM: - * - Allow all users to contact me: Send an AIM_VISIBILITYCHANGE_DENYADD - * with only your name on it. - * - Allow only users on my Buddy List: Send an - * AIM_VISIBILITYCHANGE_PERMITADD with the list the same as your - * buddy list - * - Allow only the uesrs below: Send an AIM_VISIBILITYCHANGE_PERMITADD - * with everyone listed that you want to see you. - * - Block all users: Send an AIM_VISIBILITYCHANGE_PERMITADD with only - * yourself in the list - * - Block the users below: Send an AIM_VISIBILITYCHANGE_DENYADD with - * the list of users to be blocked - * - * XXX ye gods. - */ -faim_export int aim_bos_changevisibility(aim_session_t *sess, aim_conn_t *conn, int changetype, const char *denylist) -{ - aim_frame_t *fr; - int packlen = 0; - fu16_t subtype; - char *localcpy = NULL, *tmpptr = NULL; - int i; - int listcount; - aim_snacid_t snacid; - - if (!denylist) - return -EINVAL; - - if (changetype == AIM_VISIBILITYCHANGE_PERMITADD) - subtype = 0x05; - else if (changetype == AIM_VISIBILITYCHANGE_PERMITREMOVE) - subtype = 0x06; - else if (changetype == AIM_VISIBILITYCHANGE_DENYADD) - subtype = 0x07; - else if (changetype == AIM_VISIBILITYCHANGE_DENYREMOVE) - subtype = 0x08; - else - return -EINVAL; - - localcpy = strdup(denylist); - - listcount = aimutil_itemcnt(localcpy, '&'); - packlen = aimutil_tokslen(localcpy, 99, '&') + listcount + 9; - - if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, packlen))) { - free(localcpy); - return -ENOMEM; - } - - snacid = aim_cachesnac(sess, 0x0009, subtype, 0x0000, NULL, 0); - aim_putsnac(&fr->data, 0x0009, subtype, 0x00, snacid); - - for (i = 0; (i < (listcount - 1)) && (i < 99); i++) { - tmpptr = aimutil_itemidx(localcpy, i, '&'); - - aimbs_put8(&fr->data, strlen(tmpptr)); - aimbs_putraw(&fr->data, tmpptr, strlen(tmpptr)); - - free(tmpptr); - } - free(localcpy); - - aim_tx_enqueue(sess, fr); - - return 0; -} - - - -/* * aim_bos_setbuddylist(buddylist) * * This just builds the "set buddy list" command then queues it. @@ -172,7 +76,6 @@ * aim_bos_setprofile(profile) * * Gives BOS your profile. - * * */ faim_export int aim_bos_setprofile(aim_session_t *sess, aim_conn_t *conn, const char *profile, const char *awaymsg, fu16_t caps) @@ -187,10 +90,21 @@ aim_addtlvtochain_raw(&tl, 0x0001, strlen(defencoding), defencoding); aim_addtlvtochain_raw(&tl, 0x0002, strlen(profile), profile); } - + + /* + * So here's how this works: + * - You are away when you have a non-zero-length type 4 TLV stored. + * - You become unaway when you clear the TLV with a zero-length + * type 4 TLV. + * - If you do not send the type 4 TLV, your status does not change + * (that is, if you were away, you'll remain away). + */ if (awaymsg) { - aim_addtlvtochain_raw(&tl, 0x0003, strlen(defencoding), defencoding); - aim_addtlvtochain_raw(&tl, 0x0004, strlen(awaymsg), awaymsg); + if (strlen(awaymsg)) { + aim_addtlvtochain_raw(&tl, 0x0003, strlen(defencoding), defencoding); + aim_addtlvtochain_raw(&tl, 0x0004, strlen(awaymsg), awaymsg); + } else + aim_addtlvtochain_noval(&tl, 0x0004); } aim_addtlvtochain_caps(&tl, 0x0005, caps); @@ -210,124 +124,6 @@ } /* - * aim_bos_clientready() - * - * Send Client Ready. - * - */ -faim_export int aim_clientready(aim_session_t *sess, aim_conn_t *conn) -{ - aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; - struct snacgroup *sg; - aim_frame_t *fr; - aim_snacid_t snacid; - - if (!ins) - return -EINVAL; - - if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1152))) - return -ENOMEM; - - snacid = aim_cachesnac(sess, 0x0001, 0x0002, 0x0000, NULL, 0); - aim_putsnac(&fr->data, 0x0001, 0x0002, 0x0000, snacid); - - /* - * Send only the tool versions that the server cares about (that it - * marked as supporting in the server ready SNAC). - */ - for (sg = ins->groups; sg; sg = sg->next) { - aim_module_t *mod; - - if ((mod = aim__findmodulebygroup(sess, sg->group))) { - aimbs_put16(&fr->data, mod->family); - aimbs_put16(&fr->data, mod->version); - aimbs_put16(&fr->data, mod->toolid); - aimbs_put16(&fr->data, mod->toolversion); - } else - faimdprintf(sess, 1, "aim_clientready: server supports group 0x%04x but we don't!\n", sg->group); - } - - aim_tx_enqueue(sess, fr); - - return 0; -} - -/* - * aim_bos_setprivacyflags() - * - * Sets privacy flags. Normally 0x03. - * - * Bit 1: Allows other AIM users to see how long you've been idle. - * Bit 2: Allows other AIM users to see how long you've been a member. - * - */ -faim_e... [truncated message content] |
From: Eric W. <war...@us...> - 2001-11-10 01:30:15
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory usw-pr-cvs1:/tmp/cvs-serv14277/protocols/yahoo Modified Files: yahoo.c Log Message: i think i finally fixed this. i'm such a moron sometimes. Index: yahoo.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- yahoo.c 2001/11/08 09:44:36 1.7 +++ yahoo.c 2001/11/10 01:30:13 1.8 @@ -419,7 +419,7 @@ split = g_strsplit(*tmp, ":", 2); if (!split) continue; - if (!split[1]) { + if (!split[0] || !split[1]) { g_strfreev(split); continue; } |
From: Eric W. <war...@us...> - 2001-11-10 01:22:35
|
Update of /cvsroot/gaim/gaim/src/protocols/napster In directory usw-pr-cvs1:/tmp/cvs-serv12018/protocols/napster Modified Files: napster.c Log Message: why? Index: napster.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/napster/napster.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- napster.c 2001/11/06 23:58:23 1.13 +++ napster.c 2001/11/10 01:22:31 1.14 @@ -402,15 +402,21 @@ static void nap_login_connect(gpointer data, gint source, GaimInputCondition cond) { struct gaim_connection *gc = data; - struct nap_data *ndata = gc->proto_data; + struct nap_data *ndata; char buf[NAP_BUF_LEN]; + if (!g_slist_find(connections, gc)) { + close(source); + return; + } + if (source < 0) { hide_login_progress(gc, "Unable to connect"); signoff(gc); return; } + ndata = gc->proto_data; if (ndata->fd != source) ndata->fd = source; |
From: Eric W. <war...@us...> - 2001-11-10 01:05:24
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv7162 Modified Files: gtkimhtml.c Log Message: i heard the old way was wrong. this is more correct but i feel it's still not correct enough. i wish i understood fonts. Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- gtkimhtml.c 2001/11/08 02:39:40 1.70 +++ gtkimhtml.c 2001/11/10 01:05:19 1.71 @@ -1928,13 +1928,8 @@ newvals [NAME] = names [i]; if (xflds [PTSZ][0]) { - g_snprintf (fs, sizeof (fs), "%d", - font_sizes [MIN (fontsize, MAX_SIZE) - 1] / 10); - newvals [PTSZ] = fs; - newvals [SIZE] = ""; - TRY_FONT; - newvals [PTSZ] = xflds [PTSZ]; + newvals [SIZE] = ""; } else newvals [SIZE] = xflds [SIZE]; TRY_FONT; |
From: Eric W. <war...@us...> - 2001-11-09 03:11:58
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv31835/src Modified Files: buddy_chat.c conversation.c ui.h Log Message: god damn you. Index: buddy_chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy_chat.c,v retrieving revision 1.130 retrieving revision 1.131 diff -u -d -r1.130 -r1.131 --- buddy_chat.c 2001/11/02 07:53:23 1.130 +++ buddy_chat.c 2001/11/09 03:11:56 1.131 @@ -1327,8 +1327,6 @@ b->log_dialog = NULL; sprintf(b->fontface, "%s", fontface); b->hasfont = 0; - b->fontsize = fontsize; - b->hassize = 0; b->bgcol = bgcolor; b->hasbg = 0; b->fgcol = fgcolor; Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.290 retrieving revision 1.291 diff -u -d -r1.290 -r1.291 --- conversation.c 2001/11/06 23:58:21 1.290 +++ conversation.c 2001/11/09 03:11:56 1.291 @@ -841,8 +841,8 @@ strcpy(buf, buf2); } - if ((font_options & OPT_FONT_SIZE) || c->hassize) { - g_snprintf(buf2, limit, "<FONT SIZE=\"%d\">%s</FONT>", c->fontsize, buf); + if (font_options & OPT_FONT_SIZE) { + g_snprintf(buf2, limit, "<FONT SIZE=\"%d\">%s</FONT>", fontsize, buf); strcpy(buf, buf2); } @@ -2150,8 +2150,6 @@ c->log_dialog = NULL; sprintf(c->fontface, "%s", fontface); c->hasfont = 0; - c->fontsize = fontsize; - c->hassize = 0; c->bgcol = bgcolor; c->hasbg = 0; c->fgcol = fgcolor; Index: ui.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/ui.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ui.h 2001/10/27 00:12:14 1.16 +++ ui.h 2001/11/09 03:11:56 1.17 @@ -113,8 +113,6 @@ int makesound; char fontface[128]; int hasfont; - int fontsize; - int hassize; GdkColor bgcol; int hasbg; GdkColor fgcol; |
From: Eric W. <war...@us...> - 2001-11-09 01:11:41
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory usw-pr-cvs1:/tmp/cvs-serv1240 Modified Files: oscar.c Log Message: sessionlen is much better than onlinesince Index: oscar.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- oscar.c 2001/11/07 12:39:37 1.59 +++ oscar.c 2001/11/09 01:11:36 1.60 @@ -1147,7 +1147,7 @@ g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", info->sn); g_free(tmp); - serv_got_update(gc, info->sn, 1, info->warnlevel/10, info->onlinesince, + serv_got_update(gc, info->sn, 1, info->warnlevel/10, time(NULL) - info->sessionlen, time_idle, type, info->capabilities); return 1; @@ -1895,7 +1895,7 @@ va_end(ap); gc->evil = info->warnlevel/10; - gc->correction_time = (info->onlinesince - gc->login_time); + /* gc->correction_time = (info->onlinesince - gc->login_time); */ return 1; } |
From: Eric W. <war...@us...> - 2001-11-08 09:44:40
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory usw-pr-cvs1:/tmp/cvs-serv1089/protocols/yahoo Modified Files: yahoo.c Log Message: maybe this will fix some things Index: yahoo.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- yahoo.c 2001/11/07 12:17:31 1.6 +++ yahoo.c 2001/11/08 09:44:36 1.7 @@ -417,8 +417,14 @@ lines = g_strsplit(pair->value, "\n", -1); for (tmp = lines; *tmp; tmp++) { split = g_strsplit(*tmp, ":", 2); + if (!split) + continue; + if (!split[1]) { + g_strfreev(split); + continue; + } buddies = g_strsplit(split[1], ",", -1); - for (bud = buddies; *bud; bud++) + for (bud = buddies; bud && *bud; bud++) if (!find_buddy(gc, *bud)) { add_buddy(gc, split[0], *bud, *bud); export = TRUE; |
From: Eric W. <war...@us...> - 2001-11-08 08:20:47
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv13486 Modified Files: perl.c Log Message: John Watson fixes more things :) Index: perl.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/perl.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- perl.c 2001/11/05 20:41:52 1.65 +++ perl.c 2001/11/08 08:20:43 1.66 @@ -761,7 +761,7 @@ char *tmp2, *tmp3; tmp2 = g_strdup(escape_quotes(arg2)); tmp3 = arg3 ? g_strdup(escape_quotes(arg3)) : g_malloc0(1); - buf = g_strdup_printf("'%lu','\"%s\"','%s'", (unsigned long)arg1, tmp2, tmp3); + buf = g_strdup_printf("'%lu','%s','%s'", (unsigned long)arg1, tmp2, tmp3); g_free(tmp2); g_free(tmp3); } |
From: Eric W. <war...@us...> - 2001-11-08 02:39:43
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv2372 Modified Files: gtkimhtml.c Log Message: remove the #undef's for things that aren't #define'd as well Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- gtkimhtml.c 2001/11/08 02:39:02 1.69 +++ gtkimhtml.c 2001/11/08 02:39:40 1.70 @@ -1952,8 +1952,6 @@ #undef ITALICS #undef SIZE #undef PTSZ -#undef REG -#undef ENC #undef END g_strfreev (xflds); |
From: Eric W. <war...@us...> - 2001-11-08 02:39:04
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv2181 Modified Files: gtkimhtml.c Log Message: people are going to hate me for this but for some reason my encoding was coming up as ANSI_X3.4-1968. so it didn't work for me, so i removed it. Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- gtkimhtml.c 2001/11/08 02:29:31 1.68 +++ gtkimhtml.c 2001/11/08 02:39:02 1.69 @@ -91,22 +91,6 @@ gchar **image; }; -static gchar* -getcharset () -{ - static gchar charset [64]; -#ifdef HAVE_LANGINFO_CODESET - gchar *ch = nl_langinfo (CODESET); - if (!g_strncasecmp (ch, "iso-", 4)) - g_snprintf (charset, sizeof (charset), "iso%s", ch + 4); - else - g_snprintf (charset, sizeof (charset), ch); -#else - g_snprintf (charset, sizeof (charset), "iso8859-*"); -#endif - return charset; -} - static GtkSmileyTree* gtk_smiley_tree_new () { @@ -1862,20 +1846,16 @@ #endif } -#define TRY_FONT { \ - gchar *tmp = g_strjoinv ("-", newvals); \ - GdkFont *ret_font; \ - if (default_font->type == GDK_FONT_FONT) \ - ret_font = gdk_font_load (tmp); \ - else \ - ret_font = gdk_fontset_load (tmp); \ - g_free (tmp); \ - if (ret_font) { \ - g_strfreev (xflds); \ - g_strfreev (names); \ - g_strfreev (csvals); \ - return ret_font; \ - } \ +#define TRY_FONT tmp = g_strjoinv ("-", newvals); \ + if (default_font->type == GDK_FONT_FONT) \ + ret_font = gdk_font_load (tmp); \ + else \ + ret_font = gdk_fontset_load (tmp); \ + g_free (tmp); \ + if (ret_font) { \ + g_strfreev (xflds); \ + g_strfreev (names); \ + return ret_font; \ } @@ -1894,9 +1874,10 @@ gint i; gchar **names; gchar fs[10]; - gchar *charset; - gchar **csvals; + gchar *tmp; + GdkFont *ret_font; + if (!name && !bold && !italics && !fontsize) return gdk_font_ref (default_font); @@ -1908,8 +1889,6 @@ #define ITALICS 4 #define SIZE 6 #define PTSZ 7 -#define REG 13 -#define ENC 14 #define END 15 if (name) @@ -1918,8 +1897,6 @@ names = g_new0 (gchar *, 2); names [0] = g_strdup (xflds [NAME]); } - charset = getcharset (); - csvals = g_strsplit (charset, "-", 2); for (i = 0; xflds [i]; i++) newvals [i] = xflds [i]; @@ -1933,8 +1910,6 @@ newvals [SIZE] = fs; newvals [PTSZ] = ""; } - newvals [REG] = csvals [0]; - newvals [ENC] = csvals [1]; newvals [END] = NULL; TRY_FONT; @@ -1983,7 +1958,6 @@ g_strfreev (xflds); g_strfreev (names); - g_strfreev (csvals); return gdk_font_ref (default_font); } |
From: Eric W. <war...@us...> - 2001-11-08 02:29:33
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv473 Modified Files: gtkimhtml.c Log Message: this fixes one problem but creates another Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- gtkimhtml.c 2001/11/07 21:17:32 1.67 +++ gtkimhtml.c 2001/11/08 02:29:31 1.68 @@ -1890,7 +1890,7 @@ gchar *default_name; gchar **xflds; - gchar *newvals[15]; + gchar *newvals[16]; gint i; gchar **names; gchar fs[10]; |
From: Eric W. <war...@us...> - 2001-11-07 22:25:41
|
Update of /cvsroot/gaim/gaim/plugins In directory usw-pr-cvs1:/tmp/cvs-serv29490 Modified Files: chatlist.c Log Message: there are some plugins that i wish didn't exist. Index: chatlist.c =================================================================== RCS file: /cvsroot/gaim/gaim/plugins/chatlist.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- chatlist.c 2001/11/02 10:30:39 1.6 +++ chatlist.c 2001/11/07 22:25:38 1.7 @@ -104,6 +104,7 @@ crs = crs->next; fprintf(f, "%s\n%d\n", cr->name, cr->exchange); } + g_free(x); fclose(f); } @@ -130,6 +131,7 @@ cr->exchange = atoi(buf); chat_rooms = g_list_append(chat_rooms, cr); } + g_free(x); fclose(f); setup_buddy_chats(); } |
From: Eric W. <war...@us...> - 2001-11-07 21:17:35
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv8765 Modified Files: gtkimhtml.c Log Message: you did it wrong, sean. we should take the default for the widget (which in gaim always ends up being the default for the style, but that's ok) Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- gtkimhtml.c 2001/11/07 21:02:06 1.66 +++ gtkimhtml.c 2001/11/07 21:17:32 1.67 @@ -1886,7 +1886,7 @@ gboolean italics, gint fontsize) { - GdkFont *default_font = GTK_IMHTML_GET_STYLE_FONT (GTK_WIDGET (imhtml)->style); + GdkFont *default_font = imhtml->default_font; gchar *default_name; gchar **xflds; |
From: Eric W. <war...@us...> - 2001-11-07 21:02:09
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv3137/src Modified Files: gtkimhtml.c Log Message: Sean Egan wrote this. Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- gtkimhtml.c 2001/11/04 12:54:41 1.65 +++ gtkimhtml.c 2001/11/07 21:02:06 1.66 @@ -59,9 +59,7 @@ #include "pixmaps/wink.xpm" #include "pixmaps/yell.xpm" -#define DEFAULT_FONT_NAME "helvetica" #define MAX_SIZE 7 -#define MAX_FONTS 32767 gint font_sizes [] = { 80, 100, 120, 140, 200, 300, 400 }; @@ -1853,45 +1851,33 @@ layout_class->set_scroll_adjustments = gtk_imhtml_set_scroll_adjustments; } -static gchar** -get_font_names () +static gchar* +gtk_imhtml_get_font_name (GdkFont *font) { - gint num_fonts = 0; - gchar **xfontnames; - static gchar **fonts = NULL; - gint i; - - if (fonts) - return fonts; - - xfontnames = XListFonts (GDK_DISPLAY (), "-*", MAX_FONTS, &num_fonts); - - if (!num_fonts) { - XFreeFontNames(xfontnames); - return g_new0 (char *, 1); - } - - fonts = g_new0 (char *, num_fonts + 1); - - for (i = 0; i < num_fonts; i++) { - gint countdown = 1, num_dashes = 1; - const gchar *t1 = xfontnames [i]; - const gchar *t2; - - while (*t1 && (countdown >= 0)) - if (*t1++ == '-') - countdown--; - - for (t2 = t1; *t2; t2++) - if (*t2 == '-' && --num_dashes == 0) - break; +#if GTK_CHECK_VERSION(1,3,0) + return "--*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*"; +#else + GdkFontPrivate *fontpriv = (GdkFontPrivate *) font; + return fontpriv->names->data; +#endif +} - fonts [i] = g_strndup (t1, (long) t2 - (long) t1); - } +#define TRY_FONT { \ + gchar *tmp = g_strjoinv ("-", newvals); \ + GdkFont *ret_font; \ + if (default_font->type == GDK_FONT_FONT) \ + ret_font = gdk_font_load (tmp); \ + else \ + ret_font = gdk_fontset_load (tmp); \ + g_free (tmp); \ + if (ret_font) { \ + g_strfreev (xflds); \ + g_strfreev (names); \ + g_strfreev (csvals); \ + return ret_font; \ + } \ + } - XFreeFontNames(xfontnames); - return fonts; -} static GdkFont* gtk_imhtml_font_load (GtkIMHtml *imhtml, @@ -1900,178 +1886,106 @@ gboolean italics, gint fontsize) { - gchar buf [16 * 1024]; - GdkFont *font = NULL; - XFontStruct *xfs; - static gchar **fontnames = NULL; - gchar *choice = NULL; - gint size = fontsize ? font_sizes [MIN (fontsize, MAX_SIZE) - 1] : 120; - gint i, j; - - if (!fontnames) - fontnames = get_font_names (); - - if (name) { - gchar **choices = g_strsplit (name, ",", -1); - - for (i = 0; choices [i]; i++) { - for (j = 0; fontnames [j]; j++) - if (!g_strcasecmp (fontnames [j], choices [i])) - break; - if (fontnames [j]) - break; - } - - if (choices [i]) - choice = g_strdup (choices [i]); - - g_strfreev (choices); - } else if (!bold && !italics && !fontsize && imhtml->default_font) - return gdk_font_ref (imhtml->default_font); - - if (!choice) { - for (i = 0; fontnames [i]; i++) - if (!g_strcasecmp (fontnames [i], DEFAULT_FONT_NAME)) - break; - if (fontnames [i]) - choice = g_strdup (DEFAULT_FONT_NAME); - } - - if (!choice) { - if (imhtml->default_font) - return gdk_font_ref (imhtml->default_font); - return gdk_fontset_load ("-*-*-*-*-*-*-*-*-*-*-*-*-*-*,*"); - } + GdkFont *default_font = GTK_IMHTML_GET_STYLE_FONT (GTK_WIDGET (imhtml)->style); + gchar *default_name; + gchar **xflds; - g_snprintf (buf, sizeof (buf), "-*-%s-%s-%c-*-*-*-%d-*-*-*-*-%s", - choice, - bold ? "bold" : "medium", - italics ? 'i' : 'r', - size, - getcharset()); - font = gdk_font_load (buf); + gchar *newvals[15]; + gint i; + gchar **names; + gchar fs[10]; + gchar *charset; + gchar **csvals; - if (!font && italics) { - g_snprintf (buf, sizeof (buf), "-*-%s-%s-o-*-*-*-%d-*-*-*-*-%s", - choice, - bold ? "bold" : "medium", - size, - getcharset()); - font = gdk_font_load (buf); - } + if (!name && !bold && !italics && !fontsize) + return gdk_font_ref (default_font); - if (!font) { - g_snprintf (buf, sizeof (buf), "-*-%s-%s-%c-*-*-*-*-*-*-*-*-%s", - choice, - bold ? "bold" : "medium", - italics ? 'i' : 'r', - getcharset()); - font = gdk_font_load (buf); - } + default_name = gtk_imhtml_get_font_name (default_font); + xflds = g_strsplit (default_name, "-", -1); - if (!font && italics) { - g_snprintf (buf, sizeof (buf), "-*-%s-%s-o-*-*-*-*-*-*-*-*-%s", - choice, - bold ? "bold" : "medium", - getcharset()); - font = gdk_font_load (buf); - } +#define NAME 2 +#define BOLD 3 +#define ITALICS 4 +#define SIZE 6 +#define PTSZ 7 +#define REG 13 +#define ENC 14 +#define END 15 - if (!font) { - g_snprintf (buf, sizeof (buf), "-*-%s-*-%c-*-*-*-*-*-*-*-*-%s", - choice, - italics ? 'i' : 'r', - getcharset()); - font = gdk_font_load (buf); + if (name) + names = g_strsplit (name, ",", -1); + else { + names = g_new0 (gchar *, 2); + names [0] = g_strdup (xflds [NAME]); } + charset = getcharset (); + csvals = g_strsplit (charset, "-", 2); - if (!font) { - g_snprintf (buf, sizeof (buf), "-*-%s-*-%c-*-*-*-*-*-*-*-*-%s", - choice, - italics ? 'o' : '*', - getcharset()); - font = gdk_font_load (buf); - } + for (i = 0; xflds [i]; i++) + newvals [i] = xflds [i]; - if (!font && italics) { - g_snprintf (buf, sizeof (buf), "-*-%s-*-*-*-*-*-*-*-*-*-*-%s", - choice, - getcharset()); - font = gdk_font_load (buf); + if (bold) + newvals [BOLD] = "bold"; + if (italics) + newvals [ITALICS] = "i"; + if (fontsize) { + g_snprintf (fs, sizeof (fs), "%d", font_sizes [MIN (fontsize, MAX_SIZE) - 1]); + newvals [SIZE] = fs; + newvals [PTSZ] = ""; } + newvals [REG] = csvals [0]; + newvals [ENC] = csvals [1]; + newvals [END] = NULL; - if (!font) { - g_snprintf (buf, sizeof (buf), "-*-%s-%s-%c-*-*-*-%d-*-*-*-*-*-*", - choice, - bold ? "bold" : "medium", - italics ? 'i' : 'r', - size); - font = gdk_font_load (buf); - } + TRY_FONT; - if (!font && italics) { - g_snprintf (buf, sizeof (buf), "-*-%s-%s-o-*-*-*-%d-*-*-*-*-*-*", - choice, - bold ? "bold" : "medium", - size); - font = gdk_font_load (buf); - } + for (i = 0; italics && names [i]; i++) { + newvals [NAME] = names [i]; - if (!font) { - g_snprintf (buf, sizeof (buf), "-*-%s-%s-%c-*-*-*-*-*-*-*-*-*-*", - choice, - bold ? "bold" : "medium", - italics ? 'i' : 'r'); - font = gdk_font_load (buf); - } + newvals [ITALICS] = "o"; + TRY_FONT; - if (!font) { - g_snprintf (buf, sizeof (buf), "-*-%s-%s-o-*-*-*-*-*-*-*-*-*-*", - choice, - bold ? "bold" : "medium"); - font = gdk_font_load (buf); + newvals [ITALICS] = xflds [ITALICS]; + TRY_FONT; } - if (!font) { - g_snprintf (buf, sizeof (buf), "-*-%s-*-%c-*-*-*-*-*-*-*-*-*-*", - choice, - italics ? 'i' : 'r'); - font = gdk_font_load (buf); - } + for (i = 0; fontsize && names [i]; i++) { + newvals [NAME] = names [i]; - if (!font) { - g_snprintf (buf, sizeof (buf), "-*-%s-*-%c-*-*-*-*-*-*-*-*-*-*", - choice, - italics ? 'o' : '*'); - font = gdk_font_load (buf); - } + if (xflds [PTSZ][0]) { + g_snprintf (fs, sizeof (fs), "%d", + font_sizes [MIN (fontsize, MAX_SIZE) - 1] / 10); + newvals [PTSZ] = fs; + newvals [SIZE] = ""; + TRY_FONT; - if (!font && italics) { - g_snprintf (buf, sizeof (buf), "-*-%s-*-*-*-*-*-*-*-*-*-*-*-*", - choice); - font = gdk_font_load (buf); + newvals [PTSZ] = xflds [PTSZ]; + } else + newvals [SIZE] = xflds [SIZE]; + TRY_FONT; } - - g_free (choice); - if (!font && imhtml->default_font) - return gdk_font_ref (imhtml->default_font); - - xfs = font ? GDK_FONT_XFONT (font) : NULL; - if (xfs && (xfs->min_byte1 != 0 || xfs->max_byte1 != 0)) { - gchar *tmp_name; + for (i = 0; bold && names [i]; i++) { + newvals [NAME] = names [i]; - gdk_font_unref (font); - tmp_name = g_strconcat (buf, ",*", NULL); - font = gdk_fontset_load (tmp_name); - g_free (tmp_name); + newvals [BOLD] = xflds [BOLD]; + TRY_FONT; } - if (!font) - return gdk_fontset_load ("-*-*-*-*-*-*-*-*-*-*-*-*-*-*,*"); +#undef NAME +#undef BOLD +#undef ITALICS +#undef SIZE +#undef PTSZ +#undef REG +#undef ENC +#undef END + g_strfreev (xflds); + g_strfreev (names); + g_strfreev (csvals); - return font; + return gdk_font_ref (default_font); } static void @@ -2593,7 +2507,7 @@ } } else if (bold || italics || pre) { if (pre) { - bit->font = gtk_imhtml_font_load (imhtml, "Courier", bold, italics, 0); + bit->font = gtk_imhtml_font_load (imhtml, "courier", bold, italics, 0); } else { bit->font = gtk_imhtml_font_load (imhtml, NULL, bold, italics, 0); } @@ -3114,7 +3028,7 @@ FontDetail *oldfont = fonts->data; if (!font->size) font->size = oldfont->size; - if (!font->face) + if (!font->face && oldfont->face) font->face = g_strdup (oldfont->face); if (!font->fore && oldfont->fore) font->fore = gdk_color_copy (oldfont->fore); @@ -3123,8 +3037,6 @@ } else { if (!font->size) font->size = 3; - if (!font->face) - font->face = g_strdup (DEFAULT_FONT_NAME); } fonts = g_slist_prepend (fonts, font); @@ -3137,7 +3049,8 @@ NEW_BIT (NEW_TEXT_BIT); font = fonts->data; fonts = g_slist_remove (fonts, font); - g_free (font->face); + if (font->face) + g_free (font->face); if (font->fore) gdk_color_free (font->fore); if (font->back) @@ -3313,7 +3226,7 @@ g_free (copy); - if (!fonts || ((clr = ((FontDetail *)fonts->data)->back) == NULL)) + if (!fonts || ((clr = ((FontDetail *) fonts->data)->back) == NULL)) clr = (bg != NULL) ? bg : imhtml->default_bg_color; if (!GTK_WIDGET_REALIZED (imhtml)) @@ -3542,7 +3455,8 @@ while (fonts) { FontDetail *font = fonts->data; fonts = g_slist_remove (fonts, font); - g_free (font->face); + if (font->face) + g_free (font->face); if (font->fore) gdk_color_free (font->fore); if (font->back) |
From: Adam F. <mi...@us...> - 2001-11-07 12:39:43
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory usw-pr-cvs1:/tmp/cvs-serv13803/protocols/oscar Modified Files: oscar.c Log Message: Well, I tried. We'll just go back to the old way. Its not like I work for these people or something. Index: oscar.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- oscar.c 2001/11/06 23:58:24 1.58 +++ oscar.c 2001/11/07 12:39:37 1.59 @@ -2465,7 +2465,7 @@ } if (uc & UC_UNAVAILABLE) return (char **)away_icon_xpm; - if ((uc & UC_AB) && (uc & UC_NORMAL)) + if (uc & UC_AB) return (char **)ab_xpm; if (uc & UC_AOL) return (char **)aol_icon_xpm; |
From: Eric W. <war...@us...> - 2001-11-07 12:17:34
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory usw-pr-cvs1:/tmp/cvs-serv9013/protocols/yahoo Modified Files: yahoo.c Log Message: i don't care Index: yahoo.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- yahoo.c 2001/11/07 11:14:33 1.5 +++ yahoo.c 2001/11/07 12:17:31 1.6 @@ -740,11 +740,11 @@ yd->fd = -1; yd->hash = g_hash_table_new(g_str_hash, g_str_equal); - if (!proxy_connect(user->proto_opt[USEROPT_PAGERHOST][0] ? + if (proxy_connect(user->proto_opt[USEROPT_PAGERHOST][0] ? user->proto_opt[USEROPT_PAGERHOST] : YAHOO_PAGER_HOST, user->proto_opt[USEROPT_PAGERPORT][0] ? atoi(user->proto_opt[USEROPT_PAGERPORT]) : YAHOO_PAGER_PORT, - yahoo_got_connected, gc)) { + yahoo_got_connected, gc) < 0) { hide_login_progress(gc, "Connection problem"); signoff(gc); return; |
From: Eric W. <war...@us...> - 2001-11-07 12:17:34
|
Update of /cvsroot/gaim/gaim/src/protocols/msn In directory usw-pr-cvs1:/tmp/cvs-serv9013/protocols/msn Modified Files: msn.c Log Message: i don't care Index: msn.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/msn/msn.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- msn.c 2001/11/06 23:58:23 1.34 +++ msn.c 2001/11/07 12:17:31 1.35 @@ -954,11 +954,15 @@ port = 1863; ms = g_new0(struct msn_switchboard, 1); + ms->fd = proxy_connect(ssaddr, port, msn_rng_connect, ms); + if (ms->fd < 0) { + g_free(ms); + return; + } ms->user = g_strdup(user); ms->sessid = g_strdup(sessid); ms->auth = g_strdup(auth); ms->gc = gc; - ms->fd = proxy_connect(ssaddr, port, msn_rng_connect, ms); } else if (!g_strncasecmp(buf, "SYN", 3)) { } else if (!g_strncasecmp(buf, "USR", 3)) { } else if (!g_strncasecmp(buf, "XFR", 3)) { @@ -999,13 +1003,21 @@ GET_NEXT(tmp); - ms->auth = g_strdup(tmp); ms->fd = proxy_connect(host, port, msn_ss_xfr_connect, ms); + if (ms->fd < 0) { + msn_kill_switch(ms); + return; + } + ms->auth = g_strdup(tmp); } else { close(md->fd); gaim_input_remove(md->inpa); md->inpa = 0; md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc); + if (md->fd < 0) { + hide_login_progress(gc, "Error transfering"); + signoff(gc); + } } } else if (isdigit(*buf)) { handle_errcode(buf, TRUE); @@ -1173,6 +1185,10 @@ md->inpa = 0; md->fd = 0; md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc); + if (md->fd < 0) { + hide_login_progress(gc, "Unable to transfer"); + signoff(gc); + } } else { if (isdigit(*buf)) hide_login_progress(gc, handle_errcode(buf, FALSE)); @@ -1226,6 +1242,10 @@ g_snprintf(gc->username, sizeof(gc->username), "%s", msn_normalize(gc->username)); md->fd = proxy_connect("messenger.hotmail.com", 1863, msn_login_connect, gc); + if (md->fd < 0) { + hide_login_progress(gc, "Unable to connect"); + signoff(gc); + } } static void msn_close(struct gaim_connection *gc) |
From: Eric W. <war...@us...> - 2001-11-07 11:14:38
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory usw-pr-cvs1:/tmp/cvs-serv28995/yahoo Modified Files: yahoo.c Log Message: Anyone up for some fun! Index: yahoo.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- yahoo.c 2001/11/07 08:03:20 1.4 +++ yahoo.c 2001/11/07 11:14:33 1.5 @@ -767,6 +767,7 @@ close(yd->fd); if (yd->rxqueue) g_free(yd->rxqueue); + yd->rxlen = 0; while (yd->login) { struct yahoo_buddy *buddy = yd->login->data; yd->login = g_slist_remove(yd->login, buddy); |