Mercurial > pidgin.yaz
changeset 11285:bcd7bd6a42dd
[gaim-migrate @ 13482]
Rename aim_putcap to aimbs_putcaps and get rid of some warn-related
warnings. Hardy har har
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 17 Aug 2005 02:37:14 +0000 |
parents | f24541048a64 |
children | 0c2d1b4b1351 |
files | src/protocols/oscar/aim_internal.h src/protocols/oscar/im.c src/protocols/oscar/locate.c src/protocols/oscar/oscar.c src/protocols/oscar/tlv.c |
diffstat | 5 files changed, 30 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/oscar/aim_internal.h Wed Aug 17 02:36:17 2005 +0000 +++ b/src/protocols/oscar/aim_internal.h Wed Aug 17 02:37:14 2005 +0000 @@ -89,6 +89,7 @@ faim_internal int aimbs_putraw(aim_bstream_t *bs, const fu8_t *v, int len); faim_internal int aimbs_putstr(aim_bstream_t *bs, const char *str); faim_internal int aimbs_putbs(aim_bstream_t *bs, aim_bstream_t *srcbs, int len); +faim_internal int aimbs_putcaps(aim_bstream_t *bs, fu32_t caps); /* conn.c */ faim_internal aim_conn_t *aim_cloneconn(aim_session_t *sess, aim_conn_t *src); @@ -141,7 +142,7 @@ fu16_t instance; }; -/* +/* * In SNACland, the terms 'family' and 'group' are synonymous -- the former * is my term, the latter is AOL's. */ @@ -198,7 +199,6 @@ faim_internal void aim_locate_requestuserinfo(aim_session_t *sess, const char *sn); faim_internal fu32_t aim_locate_getcaps(aim_session_t *sess, aim_bstream_t *bs, int len); faim_internal fu32_t aim_locate_getcaps_short(aim_session_t *sess, aim_bstream_t *bs, int len); -faim_internal int aim_putcap(aim_bstream_t *bs, fu32_t caps); faim_internal void aim_info_free(aim_userinfo_t *); faim_internal int aim_info_extract(aim_session_t *sess, aim_bstream_t *bs, aim_userinfo_t *); faim_internal int aim_putuserinfo(aim_bstream_t *bs, aim_userinfo_t *info);
--- a/src/protocols/oscar/im.c Wed Aug 17 02:36:17 2005 +0000 +++ b/src/protocols/oscar/im.c Wed Aug 17 02:37:14 2005 +0000 @@ -483,7 +483,7 @@ aimbs_put16(&hdrbs, 0x0000); /* Unknown! */ aimbs_putraw(&hdrbs, ck, sizeof(ck)); /* I think... */ - aim_putcap(&hdrbs, AIM_CAPS_CHAT); + aimbs_putcaps(&hdrbs, AIM_CAPS_CHAT); aim_tlvlist_add_16(&itl, 0x000a, 0x0001); aim_tlvlist_add_noval(&itl, 0x000f); @@ -546,7 +546,7 @@ aimbs_put16(&fr->data, 0x0000); aimbs_putraw(&fr->data, ck, 8); - aim_putcap(&fr->data, AIM_CAPS_BUDDYICON); + aimbs_putcaps(&fr->data, AIM_CAPS_BUDDYICON); /* TLV t(000a) */ aimbs_put16(&fr->data, 0x000a); @@ -626,7 +626,7 @@ aimbs_put16(&fr->data, 0x0000); aimbs_putraw(&fr->data, ck, 8); - aim_putcap(&fr->data, AIM_CAPS_ICQSERVERRELAY); + aimbs_putcaps(&fr->data, AIM_CAPS_ICQSERVERRELAY); /* t(000a) l(0002) v(0001) */ aimbs_put16(&fr->data, 0x000a); @@ -643,7 +643,7 @@ aimbs_putle16(&fr->data, 11 + 16 /* 11 + (sizeof CLSID) */); aimbs_putle16(&fr->data, 9); - aim_putcap(&fr->data, AIM_CAPS_EMPTY); + aimbs_putcaps(&fr->data, AIM_CAPS_EMPTY); aimbs_putle16(&fr->data, 0); aimbs_putle32(&fr->data, 0); aimbs_putle8(&fr->data, 0); @@ -725,7 +725,7 @@ aimbs_put16(&hdrbs, 0x0000); aimbs_putraw(&hdrbs, ck, 8); - aim_putcap(&hdrbs, AIM_CAPS_DIRECTIM); + aimbs_putcaps(&hdrbs, AIM_CAPS_DIRECTIM); aim_tlvlist_add_16(&itl, 0x000a, 0x0001); aim_tlvlist_add_raw(&itl, 0x0003, 4, ip); @@ -819,7 +819,7 @@ aim_bstream_init(&bs, buf, buflen); aimbs_put16(&bs, AIM_RENDEZVOUS_PROPOSE); aimbs_putraw(&bs, oft_info->cookie, 8); - aim_putcap(&bs, AIM_CAPS_SENDFILE); + aimbs_putcaps(&bs, AIM_CAPS_SENDFILE); aim_tlvlist_write(&bs, &subtl); aim_tlvlist_free(&subtl); aim_tlvlist_add_raw(&tl, 0x0005, bs.len, bs.data); @@ -874,7 +874,7 @@ aimbs_put16(&fr->data, 0x001a); aimbs_put16(&fr->data, AIM_RENDEZVOUS_ACCEPT); aimbs_putraw(&fr->data, oft_info->cookie, 8); - aim_putcap(&fr->data, AIM_CAPS_SENDFILE); + aimbs_putcaps(&fr->data, AIM_CAPS_SENDFILE); aim_tx_enqueue(sess, fr); @@ -907,7 +907,7 @@ aimbs_put16(&fr->data, 0x001a); aimbs_put16(&fr->data, AIM_RENDEZVOUS_CANCEL); aimbs_putraw(&fr->data, oft_info->cookie, 8); - aim_putcap(&fr->data, AIM_CAPS_SENDFILE); + aimbs_putcaps(&fr->data, AIM_CAPS_SENDFILE); aim_tx_enqueue(sess, fr); @@ -956,7 +956,7 @@ aimbs_putraw(&fr->data, ck, 8); /* Put the 16 byte server relay capability */ - aim_putcap(&fr->data, AIM_CAPS_ICQSERVERRELAY); + aimbs_putcaps(&fr->data, AIM_CAPS_ICQSERVERRELAY); /* TLV t(000a) */ aimbs_put16(&fr->data, 0x000a); @@ -973,7 +973,7 @@ { /* V */ aimbs_putle16(&fr->data, 0x001b); /* L */ aimbs_putle16(&fr->data, 0x0008); /* XXX - Protocol version */ - aim_putcap(&fr->data, AIM_CAPS_EMPTY); + aimbs_putcaps(&fr->data, AIM_CAPS_EMPTY); aimbs_putle16(&fr->data, 0x0000); /* Unknown */ aimbs_putle16(&fr->data, 0x0003); /* Client features? */ aimbs_putle16(&fr->data, 0x0000); /* Unknown */
--- a/src/protocols/oscar/locate.c Wed Aug 17 02:36:17 2005 +0000 +++ b/src/protocols/oscar/locate.c Wed Aug 17 02:37:14 2005 +0000 @@ -442,7 +442,7 @@ return flags; } -faim_internal int aim_putcap(aim_bstream_t *bs, fu32_t caps) +faim_internal int aimbs_putcaps(aim_bstream_t *bs, fu32_t caps) { int i;
--- a/src/protocols/oscar/oscar.c Wed Aug 17 02:36:17 2005 +0000 +++ b/src/protocols/oscar/oscar.c Wed Aug 17 02:37:14 2005 +0000 @@ -775,7 +775,7 @@ if ((userinfo != NULL) && (userinfo->warnlevel != 0)) { - tmp = g_strdup_printf("%d", userinfo->warnlevel/10.0 + .5); + tmp = g_strdup_printf("%d", (int)(userinfo->warnlevel/10.0 + .5)); oscar_string_append(str, newline, _("Warning Level"), tmp); g_free(tmp); } @@ -4935,8 +4935,6 @@ } static int gaim_parse_evilnotify(aim_session_t *sess, aim_frame_t *fr, ...) { - GaimConnection *gc = sess->aux_data; - GaimAccount *account = gaim_connection_get_account(gc); va_list ap; fu16_t newevil; aim_userinfo_t *userinfo; @@ -4946,16 +4944,14 @@ userinfo = va_arg(ap, aim_userinfo_t *); va_end(ap); - /* XXX - What's with the + 0.5? */ - //gaim_prpl_got_account_warning_level(account, (userinfo && userinfo->sn) ? userinfo->sn : NULL, (newevil/10.0) + 0.5); +#ifdef CRAZY_WARNING + gaim_prpl_got_account_warning_level(account, (userinfo && userinfo->sn) ? userinfo->sn : NULL, (newevil/10.0) + 0.5); +#endif return 1; } static int gaim_selfinfo(aim_session_t *sess, aim_frame_t *fr, ...) { - GaimConnection *gc = sess->aux_data; - GaimAccount *account = gaim_connection_get_account(gc); - GaimPresence *presence = gaim_account_get_presence(account); int warning_level; va_list ap; aim_userinfo_t *info; @@ -4964,9 +4960,18 @@ info = va_arg(ap, aim_userinfo_t *); va_end(ap); + /* + * What's with the + 0.5? + * The 0.5 is basically poor-man's rounding. Normally + * casting "13.7" to an int will truncate to "13," but + * with 13.7 + 0.5 = 14.2, which becomes "14" when + * truncated. + */ warning_level = info->warnlevel/10.0 + 0.5; - // gaim_presence_set_warning_level(presence, warning_level); +#ifdef CRAZY_WARNING + gaim_presence_set_warning_level(presence, warning_level); +#endif return 1; } @@ -5979,11 +5984,13 @@ } } +#ifdef CRAZY_WARN static void oscar_warn(GaimConnection *gc, const char *name, gboolean anonymous) { OscarData *od = (OscarData *)gc->proto_data; aim_im_warn(od->sess, od->conn, name, anonymous ? AIM_WARN_ANON : 0); } +#endif static void oscar_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) {
--- a/src/protocols/oscar/tlv.c Wed Aug 17 02:36:17 2005 +0000 +++ b/src/protocols/oscar/tlv.c Wed Aug 17 02:37:14 2005 +0000 @@ -501,7 +501,7 @@ aim_bstream_init(&bs, buf, sizeof(buf)); - aim_putcap(&bs, caps); + aimbs_putcaps(&bs, caps); return aim_tlvlist_add_raw(list, type, aim_bstream_curpos(&bs), buf); }