Mercurial > pidgin.yaz
changeset 2421:95b4ec08abec
[gaim-migrate @ 2434]
stuff
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 03 Oct 2001 20:36:33 +0000 |
parents | 938a432173b4 |
children | e5f76dc2c8d1 |
files | src/buddy_chat.c src/conversation.c src/protocols/oscar/aim.h src/protocols/oscar/aim_internal.h src/protocols/oscar/buddylist.c src/protocols/oscar/chat.c src/protocols/oscar/ft.c src/protocols/oscar/im.c src/protocols/oscar/info.c src/protocols/oscar/login.c src/protocols/oscar/oscar.c src/protocols/oscar/tlv.c |
diffstat | 12 files changed, 148 insertions(+), 58 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buddy_chat.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/buddy_chat.c Wed Oct 03 20:36:33 2001 +0000 @@ -1384,6 +1384,9 @@ GTK_SIGNAL_FUNC(invite_callback), c); gtk_signal_connect(GTK_OBJECT(c->whisper), "clicked", GTK_SIGNAL_FUNC(whisper_callback), c); + + update_buttons_by_protocol(c); + bcs = bcs->next; } C = C->next;
--- a/src/conversation.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/conversation.c Wed Oct 03 20:36:33 2001 +0000 @@ -760,7 +760,7 @@ gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); } else if (((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) || (c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) && - (event->state & GDK_MOD1_MASK) && isdigit(event->keyval) && (event->keyval > '0')) { + (event->state & GDK_MOD1_MASK) && (event->keyval > '0') && (event->keyval <= '9')) { GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); gtk_notebook_set_page(GTK_NOTEBOOK(notebook), event->keyval - '1'); gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
--- a/src/protocols/oscar/aim.h Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/aim.h Wed Oct 03 20:36:33 2001 +0000 @@ -375,21 +375,31 @@ /* * AIM User Info, Standard Form. */ -struct aim_userinfo_s { +typedef struct { char sn[MAXSNLEN+1]; fu16_t warnlevel; fu16_t idletime; fu16_t flags; fu32_t membersince; fu32_t onlinesince; - fu32_t sessionlen; + fu32_t sessionlen; + int capspresent; fu16_t capabilities; struct { fu16_t status; fu32_t ipaddr; fu8_t crap[0x25]; /* until we figure it out... */ } icqinfo; -}; +} aim_userinfo_t; + +faim_export const char *aim_userinfo_sn(aim_userinfo_t *ui); +faim_export fu16_t aim_userinfo_flags(aim_userinfo_t *ui); +faim_export fu16_t aim_userinfo_idle(aim_userinfo_t *ui); +faim_export float aim_userinfo_warnlevel(aim_userinfo_t *ui); +faim_export time_t aim_userinfo_membersince(aim_userinfo_t *ui); +faim_export time_t aim_userinfo_onlinesince(aim_userinfo_t *ui); +faim_export fu32_t aim_userinfo_sessionlen(aim_userinfo_t *ui); +faim_export int aim_userinfo_hascap(aim_userinfo_t *ui, fu16_t cap); #define AIM_FLAG_UNCONFIRMED 0x0001 /* "damned transients" */ #define AIM_FLAG_ADMINISTRATOR 0x0002 @@ -449,7 +459,7 @@ faim_internal int aim_addtlvtochain_raw(aim_tlvlist_t **list, const fu16_t t, const fu16_t l, const fu8_t *v); faim_internal int aim_addtlvtochain_caps(aim_tlvlist_t **list, const fu16_t t, const fu16_t caps); faim_internal int aim_addtlvtochain_noval(aim_tlvlist_t **list, const fu16_t type); -faim_internal int aim_addtlvtochain_userinfo(aim_tlvlist_t **list, fu16_t type, struct aim_userinfo_s *ui); +faim_internal int aim_addtlvtochain_userinfo(aim_tlvlist_t **list, fu16_t type, aim_userinfo_t *ui); faim_internal int aim_addtlvtochain_frozentlvlist(aim_tlvlist_t **list, fu16_t type, aim_tlvlist_t **tl); faim_internal int aim_counttlvchain(aim_tlvlist_t **list); faim_internal int aim_sizetlvchain(aim_tlvlist_t **list); @@ -835,7 +845,7 @@ faim_export aim_conn_t *aim_accepttransfer(aim_session_t *sess, aim_conn_t *conn, const char *sn, const fu8_t *cookie, const fu8_t *ip, fu16_t listingfiles, fu16_t listingtotsize, fu16_t listingsize, fu32_t listingchecksum, fu16_t rendid); faim_export int aim_getinfo(aim_session_t *, aim_conn_t *, const char *, unsigned short); -faim_export int aim_sendbuddyoncoming(aim_session_t *sess, aim_conn_t *conn, struct aim_userinfo_s *info); +faim_export int aim_sendbuddyoncoming(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *info); faim_export int aim_sendbuddyoffgoing(aim_session_t *sess, aim_conn_t *conn, const char *sn); #define AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED 0x00000001
--- a/src/protocols/oscar/aim_internal.h Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/aim_internal.h Wed Oct 03 20:36:33 2001 +0000 @@ -160,8 +160,8 @@ faim_internal int aim_msgcookie_gettype(int reqclass); faim_internal int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie); -faim_internal int aim_extractuserinfo(aim_session_t *sess, aim_bstream_t *bs, struct aim_userinfo_s *); -faim_internal int aim_putuserinfo(aim_bstream_t *bs, struct aim_userinfo_s *info); +faim_internal int aim_extractuserinfo(aim_session_t *sess, aim_bstream_t *bs, aim_userinfo_t *); +faim_internal int aim_putuserinfo(aim_bstream_t *bs, aim_userinfo_t *info); faim_internal int aim_chat_readroominfo(aim_bstream_t *bs, struct aim_chat_roominfo *outinfo);
--- a/src/protocols/oscar/buddylist.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/buddylist.c Wed Oct 03 20:36:33 2001 +0000 @@ -13,7 +13,7 @@ */ static int buddychange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { - struct aim_userinfo_s userinfo; + aim_userinfo_t userinfo; aim_rxcallback_t userfunc; aim_extractuserinfo(sess, bs, &userinfo);
--- a/src/protocols/oscar/chat.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/chat.c Wed Oct 03 20:36:33 2001 +0000 @@ -389,7 +389,7 @@ */ static int infoupdate(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { - struct aim_userinfo_s *userinfo = NULL; + aim_userinfo_t *userinfo = NULL; aim_rxcallback_t userfunc; int ret = 0; int usercount = 0; @@ -443,7 +443,7 @@ tmptlv = aim_gettlv(tlvlist, 0x0073, 1); /* Allocate enough userinfo structs for all occupants */ - userinfo = calloc(usercount, sizeof(struct aim_userinfo_s)); + userinfo = calloc(usercount, sizeof(aim_userinfo_t)); aim_bstream_init(&occbs, tmptlv->value, tmptlv->length); @@ -551,13 +551,13 @@ static int userlistchange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { - struct aim_userinfo_s *userinfo = NULL; + aim_userinfo_t *userinfo = NULL; aim_rxcallback_t userfunc; int curcount = 0, ret = 0; while (aim_bstream_empty(bs)) { curcount++; - userinfo = realloc(userinfo, curcount * sizeof(struct aim_userinfo_s)); + userinfo = realloc(userinfo, curcount * sizeof(aim_userinfo_t)); aim_extractuserinfo(sess, bs, &userinfo[curcount-1]); } @@ -594,7 +594,7 @@ */ static int incomingmsg(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { - struct aim_userinfo_s userinfo; + aim_userinfo_t userinfo; aim_rxcallback_t userfunc; int ret = 0; fu8_t *cookie; @@ -603,7 +603,7 @@ char *msg = NULL; aim_msgcookie_t *ck; - memset(&userinfo, 0, sizeof(struct aim_userinfo_s)); + memset(&userinfo, 0, sizeof(aim_userinfo_t)); /* * ICBM Cookie. Uncache it.
--- a/src/protocols/oscar/ft.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/ft.c Wed Oct 03 20:36:33 2001 +0000 @@ -825,7 +825,7 @@ return -1; } - if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on) != 0)) { + if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) != 0) { perror("setsockopt(listenfd)"); close(listenfd); return -1;
--- a/src/protocols/oscar/im.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/im.c Wed Oct 03 20:36:33 2001 +0000 @@ -794,7 +794,7 @@ * 0101 000b 0000 0000 3c2f 4854 4d4c 3e another ASCII part * */ -static int incomingim_ch1(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, fu16_t channel, struct aim_userinfo_s *userinfo, aim_bstream_t *bs, fu8_t *cookie) +static int incomingim_ch1(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, fu16_t channel, aim_userinfo_t *userinfo, aim_bstream_t *bs, fu8_t *cookie) { fu16_t type, length; aim_rxcallback_t userfunc; @@ -893,7 +893,7 @@ return ret; } -static int incomingim_ch2_buddylist(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) +static int incomingim_ch2_buddylist(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) { aim_rxcallback_t userfunc; int ret = 0; @@ -955,7 +955,7 @@ return ret; } -static int incomingim_ch2_buddyicon(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) +static int incomingim_ch2_buddyicon(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) { aim_rxcallback_t userfunc; int ret = 0; @@ -979,7 +979,7 @@ return ret; } -static int incomingim_ch2_voice(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) +static int incomingim_ch2_voice(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) { aim_msgcookie_t *cachedcook; int ret = 0; @@ -1005,7 +1005,7 @@ return ret; } -static int incomingim_ch2_chat(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) +static int incomingim_ch2_chat(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) { aim_tlv_t *miscinfo; aim_bstream_t tbs; @@ -1038,7 +1038,7 @@ return ret; } -static int incomingim_ch2_getfile(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) +static int incomingim_ch2_getfile(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) { char ip[30]; aim_msgcookie_t *cachedcook; @@ -1083,7 +1083,7 @@ return ret; } -static int incomingim_ch2_sendfile(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) +static int incomingim_ch2_sendfile(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) { #if 0 char ip[30]; @@ -1145,7 +1145,7 @@ return 0; } -static int incomingim_ch2_imimage(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) +static int incomingim_ch2_imimage(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2) { aim_rxcallback_t userfunc; int ret = 0; @@ -1204,7 +1204,7 @@ } /* XXX Ugh. I think its obvious. */ -static int incomingim_ch2(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, fu16_t channel, struct aim_userinfo_s *userinfo, aim_tlvlist_t *tlvlist, fu8_t *cookie) +static int incomingim_ch2(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, fu16_t channel, aim_userinfo_t *userinfo, aim_tlvlist_t *tlvlist, fu8_t *cookie) { aim_tlv_t *block1; aim_tlvlist_t *list2; @@ -1357,9 +1357,9 @@ int i, ret = 0; fu8_t cookie[8]; fu16_t channel; - struct aim_userinfo_s userinfo; + aim_userinfo_t userinfo; - memset(&userinfo, 0x00, sizeof(struct aim_userinfo_s)); + memset(&userinfo, 0x00, sizeof(aim_userinfo_t)); /* * Read ICBM Cookie. And throw away. @@ -1542,7 +1542,7 @@ int ret = 0; aim_rxcallback_t userfunc; fu16_t channel, nummissed, reason; - struct aim_userinfo_s userinfo; + aim_userinfo_t userinfo; while (aim_bstream_empty(bs)) {
--- a/src/protocols/oscar/info.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/info.c Wed Oct 03 20:36:33 2001 +0000 @@ -43,6 +43,79 @@ return 0; } +faim_export const char *aim_userinfo_sn(aim_userinfo_t *ui) +{ + + if (!ui) + return NULL; + + return ui->sn; +} + +faim_export fu16_t aim_userinfo_flags(aim_userinfo_t *ui) +{ + + if (!ui) + return 0; + + return ui->flags; +} + +faim_export fu16_t aim_userinfo_idle(aim_userinfo_t *ui) +{ + + if (!ui) + return 0; + + return ui->idletime; +} + +faim_export float aim_userinfo_warnlevel(aim_userinfo_t *ui) +{ + + if (!ui) + return 0.00; + + return (ui->warnlevel / 10); +} + +faim_export time_t aim_userinfo_membersince(aim_userinfo_t *ui) +{ + + if (!ui) + return 0; + + return (time_t)ui->membersince; +} + +faim_export time_t aim_userinfo_onlinesince(aim_userinfo_t *ui) +{ + + if (!ui) + return 0; + + return (time_t)ui->onlinesince; +} + +faim_export fu32_t aim_userinfo_sessionlen(aim_userinfo_t *ui) +{ + + if (!ui) + return 0; + + return ui->sessionlen; +} + +faim_export int aim_userinfo_hascap(aim_userinfo_t *ui, fu16_t cap) +{ + + if (!ui || !ui->capspresent) + return -1; + + return !!(ui->capabilities & cap); +} + + /* * Capability blocks. */ @@ -158,7 +231,7 @@ * AIM is fairly regular about providing user info. This is a generic * routine to extract it in its standard form. */ -faim_internal int aim_extractuserinfo(aim_session_t *sess, aim_bstream_t *bs, struct aim_userinfo_s *outinfo) +faim_internal int aim_extractuserinfo(aim_session_t *sess, aim_bstream_t *bs, aim_userinfo_t *outinfo) { int curtlv, tlvcnt; fu8_t snlen; @@ -167,7 +240,7 @@ return -EINVAL; /* Clear out old data first */ - memset(outinfo, 0x00, sizeof(struct aim_userinfo_s)); + memset(outinfo, 0x00, sizeof(aim_userinfo_t)); /* * Screen name. Stored as an unterminated string prepended with a @@ -283,6 +356,7 @@ * */ outinfo->capabilities = aim_getcap(sess, bs, length); + outinfo->capspresent = 1; } else if (type == 0x000e) { /* @@ -337,7 +411,7 @@ /* * Inverse of aim_extractuserinfo() */ -faim_internal int aim_putuserinfo(aim_bstream_t *bs, struct aim_userinfo_s *info) +faim_internal int aim_putuserinfo(aim_bstream_t *bs, aim_userinfo_t *info) { aim_tlvlist_t *tlvlist = NULL; @@ -373,7 +447,7 @@ return 0; } -faim_export int aim_sendbuddyoncoming(aim_session_t *sess, aim_conn_t *conn, struct aim_userinfo_s *info) +faim_export int aim_sendbuddyoncoming(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *info) { aim_frame_t *fr; aim_snacid_t snacid; @@ -469,7 +543,7 @@ static int userinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { - struct aim_userinfo_s userinfo; + aim_userinfo_t userinfo; char *text_encoding = NULL, *text = NULL; aim_rxcallback_t userfunc; aim_tlvlist_t *tlvlist;
--- a/src/protocols/oscar/login.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/login.c Wed Oct 03 20:36:33 2001 +0000 @@ -617,9 +617,9 @@ { aim_rxcallback_t userfunc; fu16_t newevil; - struct aim_userinfo_s userinfo; + aim_userinfo_t userinfo; - memset(&userinfo, 0, sizeof(struct aim_userinfo_s)); + memset(&userinfo, 0, sizeof(aim_userinfo_t)); newevil = aimbs_get16(bs);
--- a/src/protocols/oscar/oscar.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/oscar.c Wed Oct 03 20:36:33 2001 +0000 @@ -1121,7 +1121,7 @@ } static int gaim_parse_oncoming(aim_session_t *sess, aim_frame_t *fr, ...) { - struct aim_userinfo_s *info; + aim_userinfo_t *info; time_t time_idle; int type = 0; struct gaim_connection *gc = sess->aux_data; @@ -1129,7 +1129,7 @@ va_list ap; va_start(ap, fr); - info = va_arg(ap, struct aim_userinfo_s *); + info = va_arg(ap, aim_userinfo_t *); va_end(ap); if (info->flags & AIM_FLAG_ACTIVEBUDDY) @@ -1163,12 +1163,12 @@ } static int gaim_parse_offgoing(aim_session_t *sess, aim_frame_t *fr, ...) { - struct aim_userinfo_s *info; + aim_userinfo_t *info; va_list ap; struct gaim_connection *gc = sess->aux_data; va_start(ap, fr); - info = va_arg(ap, struct aim_userinfo_s *); + info = va_arg(ap, aim_userinfo_t *); va_end(ap); serv_got_update(gc, info->sn, 0, 0, 0, 0, 0, 0); @@ -1267,7 +1267,7 @@ return TRUE; } -static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch1_args *args) { +static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) { char *tmp = g_malloc(BUF_LONG); struct gaim_connection *gc = sess->aux_data; int flags = 0; @@ -1351,7 +1351,7 @@ return 1; } -static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args) { +static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) { struct gaim_connection *gc = sess->aux_data; if (args->reqclass & AIM_CAPS_CHAT) { @@ -1398,12 +1398,12 @@ static int gaim_parse_incoming_im(aim_session_t *sess, aim_frame_t *fr, ...) { int channel, ret = 0; - struct aim_userinfo_s *userinfo; + aim_userinfo_t *userinfo; va_list ap; va_start(ap, fr); channel = va_arg(ap, int); - userinfo = va_arg(ap, struct aim_userinfo_s *); + userinfo = va_arg(ap, aim_userinfo_t *); /* channel 1: standard message */ if (channel == 1) { @@ -1429,12 +1429,12 @@ static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; fu16_t chan, nummissed, reason; - struct aim_userinfo_s *userinfo; + aim_userinfo_t *userinfo; char buf[1024]; va_start(ap, fr); chan = (fu16_t)va_arg(ap, unsigned int); - userinfo = va_arg(ap, struct aim_userinfo_s *); + userinfo = va_arg(ap, aim_userinfo_t *); nummissed = (fu16_t)va_arg(ap, unsigned int); reason = (fu16_t)va_arg(ap, unsigned int); va_end(ap); @@ -1562,7 +1562,7 @@ } static int gaim_parse_user_info(aim_session_t *sess, aim_frame_t *fr, ...) { - struct aim_userinfo_s *info; + aim_userinfo_t *info; char *prof_enc = NULL, *prof = NULL; fu16_t infotype; char buf[BUF_LONG]; @@ -1572,7 +1572,7 @@ char *asc; va_start(ap, fr); - info = va_arg(ap, struct aim_userinfo_s *); + info = va_arg(ap, aim_userinfo_t *); prof_enc = va_arg(ap, char *); prof = va_arg(ap, char *); infotype = (fu16_t)va_arg(ap, unsigned int); @@ -1712,14 +1712,14 @@ static int gaim_chat_join(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; int count, i; - struct aim_userinfo_s *info; + aim_userinfo_t *info; struct gaim_connection *g = sess->aux_data; struct chat_connection *c = NULL; va_start(ap, fr); count = va_arg(ap, int); - info = va_arg(ap, struct aim_userinfo_s *); + info = va_arg(ap, aim_userinfo_t *); va_end(ap); c = find_oscar_chat_by_conn(g, fr->conn); @@ -1735,14 +1735,14 @@ static int gaim_chat_leave(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; int count, i; - struct aim_userinfo_s *info; + aim_userinfo_t *info; struct gaim_connection *g = sess->aux_data; struct chat_connection *c = NULL; va_start(ap, fr); count = va_arg(ap, int); - info = va_arg(ap, struct aim_userinfo_s *); + info = va_arg(ap, aim_userinfo_t *); va_end(ap); c = find_oscar_chat_by_conn(g, fr->conn); @@ -1757,7 +1757,7 @@ static int gaim_chat_info_update(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; - struct aim_userinfo_s *userinfo; + aim_userinfo_t *userinfo; struct aim_chat_roominfo *roominfo; char *roomname; int usercount; @@ -1771,7 +1771,7 @@ roominfo = va_arg(ap, struct aim_chat_roominfo *); roomname = va_arg(ap, char *); usercount= va_arg(ap, int); - userinfo = va_arg(ap, struct aim_userinfo_s *); + userinfo = va_arg(ap, aim_userinfo_t *); roomdesc = va_arg(ap, char *); unknown_c9 = (fu16_t)va_arg(ap, int); creationtime = (fu32_t)va_arg(ap, unsigned long); @@ -1792,14 +1792,14 @@ static int gaim_chat_incoming_msg(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; - struct aim_userinfo_s *info; + aim_userinfo_t *info; char *msg; struct gaim_connection *gc = sess->aux_data; struct chat_connection *ccon = find_oscar_chat_by_conn(gc, fr->conn); char *tmp; va_start(ap, fr); - info = va_arg(ap, struct aim_userinfo_s *); + info = va_arg(ap, aim_userinfo_t *); msg = va_arg(ap, char *); tmp = g_malloc(BUF_LONG); @@ -1879,12 +1879,12 @@ static int gaim_parse_evilnotify(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; fu16_t newevil; - struct aim_userinfo_s *userinfo; + aim_userinfo_t *userinfo; struct gaim_connection *gc = sess->aux_data; va_start(ap, fr); newevil = (fu16_t)va_arg(ap, unsigned int); - userinfo = va_arg(ap, struct aim_userinfo_s *); + userinfo = va_arg(ap, aim_userinfo_t *); va_end(ap); serv_got_eviled(gc, (userinfo && userinfo->sn[0]) ? userinfo->sn : NULL, newevil / 10);
--- a/src/protocols/oscar/tlv.c Wed Oct 03 19:42:31 2001 +0000 +++ b/src/protocols/oscar/tlv.c Wed Oct 03 20:36:33 2001 +0000 @@ -266,6 +266,9 @@ fu8_t buf[16*16]; /* icky fixed length buffer */ aim_bstream_t bs; + if (!caps) + return 0; /* nothing there anyway */ + aim_bstream_init(&bs, buf, sizeof(buf)); aim_putcap(&bs, caps); @@ -273,7 +276,7 @@ return aim_addtlvtochain_raw(list, t, aim_bstream_curpos(&bs), buf); } -faim_internal int aim_addtlvtochain_userinfo(aim_tlvlist_t **list, fu16_t type, struct aim_userinfo_s *ui) +faim_internal int aim_addtlvtochain_userinfo(aim_tlvlist_t **list, fu16_t type, aim_userinfo_t *ui) { fu8_t buf[1024]; /* bleh */ aim_bstream_t bs;