Mercurial > pidgin.yaz
diff libpurple/protocols/oscar/family_icbm.c @ 25416:6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
places in the code. I've been using the definitions from the jabber
specs, where "user" is me and "buddy" is someone on my buddy list.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 26 Jan 2009 09:12:04 +0000 |
parents | 531922f4ea2a |
children | 4b8c4870b13a |
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_icbm.c Mon Jan 26 06:44:00 2009 +0000 +++ b/libpurple/protocols/oscar/family_icbm.c Mon Jan 26 09:12:04 2009 +0000 @@ -61,16 +61,16 @@ * @param bs The bstream to write the ICBM header to. * @param c c is for cookie, and cookie is for me. * @param channel The ICBM channel (1 through 4). - * @param sn Null-terminated scrizeen nizame. + * @param bn Null-terminated scrizeen nizame. * @return The number of bytes written. It's really not useful. */ -static int aim_im_puticbm(ByteStream *bs, const guchar *c, guint16 channel, const char *sn) +static int aim_im_puticbm(ByteStream *bs, const guchar *c, guint16 channel, const char *bn) { byte_stream_putraw(bs, c, 8); byte_stream_put16(bs, channel); - byte_stream_put8(bs, strlen(sn)); - byte_stream_putstr(bs, sn); - return 8+2+1+strlen(sn); + byte_stream_put8(bs, strlen(bn)); + byte_stream_putstr(bs, bn); + return 8+2+1+strlen(bn); } /** @@ -324,7 +324,7 @@ aim_icbm_makecookie(cookie); /* ICBM header */ - aim_im_puticbm(&data, cookie, 0x0001, args->destsn); + aim_im_puticbm(&data, cookie, 0x0001, args->destbn); /* Message TLV (type 0x0002) */ byte_stream_put16(&data, 0x0002); @@ -410,7 +410,7 @@ } /* XXX - should be optional */ - snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, args->destsn, strlen(args->destsn)+1); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, args->destbn, strlen(args->destbn)+1); flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &data); byte_stream_destroy(&data); @@ -431,11 +431,11 @@ * that requires an explicit message length. Use aim_im_sendch1_ext(). * */ -int aim_im_sendch1(OscarData *od, const char *sn, guint16 flags, const char *msg) +int aim_im_sendch1(OscarData *od, const char *bn, guint16 flags, const char *msg) { struct aim_sendimext_args args; - args.destsn = sn; + args.destbn = bn; args.flags = flags; args.msg = msg; args.msglen = strlen(msg); @@ -451,7 +451,7 @@ /* * Subtype 0x0006 - Send a chat invitation. */ -int aim_im_sendch2_chatinvite(OscarData *od, const char *sn, const char *msg, guint16 exchange, const char *roomname, guint16 instance) +int aim_im_sendch2_chatinvite(OscarData *od, const char *bn, const char *msg, guint16 exchange, const char *roomname, guint16 instance) { FlapConnection *conn; ByteStream bs; @@ -465,18 +465,18 @@ if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; - if (!sn || !msg || !roomname) + if (!bn || !msg || !roomname) return -EINVAL; aim_icbm_makecookie(cookie); - byte_stream_new(&bs, 1142+strlen(sn)+strlen(roomname)+strlen(msg)); - - snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, sn, strlen(sn)+1); + byte_stream_new(&bs, 1142+strlen(bn)+strlen(roomname)+strlen(msg)); + + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, bn, strlen(bn)+1); /* XXX should be uncached by an unwritten 'invite accept' handler */ priv = g_malloc(sizeof(struct aim_invite_priv)); - priv->sn = g_strdup(sn); + priv->bn = g_strdup(bn); priv->roomname = g_strdup(roomname); priv->exchange = exchange; priv->instance = instance; @@ -487,7 +487,7 @@ g_free(priv); /* ICBM Header */ - aim_im_puticbm(&bs, cookie, 0x0002, sn); + aim_im_puticbm(&bs, cookie, 0x0002, bn); /* * TLV t(0005) @@ -532,7 +532,7 @@ * This is also performance sensitive. (If you can believe it...) * */ -int aim_im_sendch2_icon(OscarData *od, const char *sn, const guint8 *icon, int iconlen, time_t stamp, guint16 iconsum) +int aim_im_sendch2_icon(OscarData *od, const char *bn, const guint8 *icon, int iconlen, time_t stamp, guint16 iconsum) { FlapConnection *conn; ByteStream bs; @@ -542,17 +542,17 @@ if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; - if (!sn || !icon || (iconlen <= 0) || (iconlen >= MAXICONLEN)) + if (!bn || !icon || (iconlen <= 0) || (iconlen >= MAXICONLEN)) return -EINVAL; aim_icbm_makecookie(cookie); - byte_stream_new(&bs, 8+2+1+strlen(sn)+2+2+2+8+16+2+2+2+2+2+2+2+4+4+4+iconlen+strlen(AIM_ICONIDENT)+2+2); + byte_stream_new(&bs, 8+2+1+strlen(bn)+2+2+2+8+16+2+2+2+2+2+2+2+4+4+4+iconlen+strlen(AIM_ICONIDENT)+2+2); snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ - aim_im_puticbm(&bs, cookie, 0x0002, sn); + aim_im_puticbm(&bs, cookie, 0x0002, bn); /* * TLV t(0005) @@ -623,7 +623,7 @@ if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; - if (!args || !args->destsn || !args->rtfmsg) + if (!args || !args->destbn || !args->rtfmsg) return -EINVAL; servdatalen = 2+2+16+2+4+1+2 + 2+2+4+4+4 + 2+4+2+strlen(args->rtfmsg)+1 + 4+4+4+strlen(rtfcap)+1; @@ -635,7 +635,7 @@ snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ - aim_im_puticbm(&bs, cookie, 0x0002, args->destsn); + aim_im_puticbm(&bs, cookie, 0x0002, args->destbn); /* TLV t(0005) - Encompasses everything below. */ byte_stream_put16(&bs, 0x0005); @@ -708,12 +708,12 @@ if (conn == NULL) return; - byte_stream_new(&bs, 118+strlen(peer_conn->sn)); + byte_stream_new(&bs, 118+strlen(peer_conn->bn)); snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ - aim_im_puticbm(&bs, peer_conn->cookie, 0x0002, peer_conn->sn); + aim_im_puticbm(&bs, peer_conn->cookie, 0x0002, peer_conn->bn); aim_tlvlist_add_noval(&outer_tlvlist, 0x0003); @@ -757,12 +757,12 @@ if (conn == NULL) return; - byte_stream_new(&bs, 11+strlen(peer_conn->sn) + 4+2+8+16); + byte_stream_new(&bs, 11+strlen(peer_conn->bn) + 4+2+8+16); snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ - aim_im_puticbm(&bs, peer_conn->cookie, 0x0002, peer_conn->sn); + aim_im_puticbm(&bs, peer_conn->cookie, 0x0002, peer_conn->bn); byte_stream_put16(&bs, 0x0005); byte_stream_put16(&bs, 0x001a); @@ -783,7 +783,7 @@ * "I want to connect through a proxy server" */ void -aim_im_sendch2_odc_requestdirect(OscarData *od, guchar *cookie, const char *sn, const guint8 *ip, guint16 port, guint16 requestnumber) +aim_im_sendch2_odc_requestdirect(OscarData *od, guchar *cookie, const char *bn, const guint8 *ip, guint16 port, guint16 requestnumber) { FlapConnection *conn; ByteStream bs; @@ -795,12 +795,12 @@ if (conn == NULL) return; - byte_stream_new(&bs, 246+strlen(sn)); + byte_stream_new(&bs, 246+strlen(bn)); snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ - aim_im_puticbm(&bs, cookie, 0x0002, sn); + aim_im_puticbm(&bs, cookie, 0x0002, bn); aim_tlvlist_add_noval(&outer_tlvlist, 0x0003); @@ -835,7 +835,7 @@ * remote user to connect to us via a proxy server. */ void -aim_im_sendch2_odc_requestproxy(OscarData *od, guchar *cookie, const char *sn, const guint8 *ip, guint16 pin, guint16 requestnumber) +aim_im_sendch2_odc_requestproxy(OscarData *od, guchar *cookie, const char *bn, const guint8 *ip, guint16 pin, guint16 requestnumber) { FlapConnection *conn; ByteStream bs; @@ -848,12 +848,12 @@ if (conn == NULL) return; - byte_stream_new(&bs, 246+strlen(sn)); + byte_stream_new(&bs, 246+strlen(bn)); snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ - aim_im_puticbm(&bs, cookie, 0x0002, sn); + aim_im_puticbm(&bs, cookie, 0x0002, bn); aim_tlvlist_add_noval(&outer_tlvlist, 0x0003); @@ -898,7 +898,7 @@ * */ void -aim_im_sendch2_sendfile_requestdirect(OscarData *od, guchar *cookie, const char *sn, const guint8 *ip, guint16 port, guint16 requestnumber, const gchar *filename, guint32 size, guint16 numfiles) +aim_im_sendch2_sendfile_requestdirect(OscarData *od, guchar *cookie, const char *bn, const guint8 *ip, guint16 port, guint16 requestnumber, const gchar *filename, guint32 size, guint16 numfiles) { FlapConnection *conn; ByteStream bs; @@ -915,7 +915,7 @@ snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ - aim_im_puticbm(&bs, cookie, 0x0002, sn); + aim_im_puticbm(&bs, cookie, 0x0002, bn); aim_tlvlist_add_noval(&outer_tlvlist, 0x0003); @@ -981,7 +981,7 @@ * remote user to connect to us via a proxy server. */ void -aim_im_sendch2_sendfile_requestproxy(OscarData *od, guchar *cookie, const char *sn, const guint8 *ip, guint16 pin, guint16 requestnumber, const gchar *filename, guint32 size, guint16 numfiles) +aim_im_sendch2_sendfile_requestproxy(OscarData *od, guchar *cookie, const char *bn, const guint8 *ip, guint16 pin, guint16 requestnumber, const gchar *filename, guint32 size, guint16 numfiles) { FlapConnection *conn; ByteStream bs; @@ -999,7 +999,7 @@ snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ - aim_im_puticbm(&bs, cookie, 0x0002, sn); + aim_im_puticbm(&bs, cookie, 0x0002, bn); aim_tlvlist_add_noval(&outer_tlvlist, 0x0003); @@ -1073,29 +1073,29 @@ * Subtype 0x0006 - Request the status message of the given ICQ user. * * @param od The oscar session. - * @param sn The UIN of the user of whom you wish to request info. + * @param bn The UIN of the user of whom you wish to request info. * @param type The type of info you wish to request. This should be the current * state of the user, as one of the AIM_ICQ_STATE_* defines. * @return Return 0 if no errors, otherwise return the error number. */ -int aim_im_sendch2_geticqaway(OscarData *od, const char *sn, int type) +int aim_im_sendch2_geticqaway(OscarData *od, const char *bn, int type) { FlapConnection *conn; ByteStream bs; aim_snacid_t snacid; guchar cookie[8]; - if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM)) || !sn) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM)) || !bn) return -EINVAL; aim_icbm_makecookie(cookie); - byte_stream_new(&bs, 8+2+1+strlen(sn) + 4+0x5e + 4); + byte_stream_new(&bs, 8+2+1+strlen(bn) + 4+0x5e + 4); snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ - aim_im_puticbm(&bs, cookie, 0x0002, sn); + aim_im_puticbm(&bs, cookie, 0x0002, bn); /* TLV t(0005) - Encompasses almost everything below. */ byte_stream_put16(&bs, 0x0005); /* T */ @@ -1176,12 +1176,12 @@ * but thats ok, because it gives me time to try to figure out what kind of drugs the AOL people * were taking when they merged the two protocols. * - * @param sn The destination screen name. + * @param bn The destination buddy name. * @param type The type of message. 0x0007 for authorization denied. 0x0008 for authorization granted. * @param message The message you want to send, it should be null terminated. * @return Return 0 if no errors, otherwise return the error number. */ -int aim_im_sendch4(OscarData *od, const char *sn, guint16 type, const char *message) +int aim_im_sendch4(OscarData *od, const char *bn, guint16 type, const char *message) { FlapConnection *conn; ByteStream bs; @@ -1191,17 +1191,17 @@ if (!od || !(conn = flap_connection_findbygroup(od, 0x0002))) return -EINVAL; - if (!sn || !type || !message) + if (!bn || !type || !message) return -EINVAL; - byte_stream_new(&bs, 8+3+strlen(sn)+12+strlen(message)+1+4); + byte_stream_new(&bs, 8+3+strlen(bn)+12+strlen(message)+1+4); snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); aim_icbm_makecookie(cookie); /* ICBM header */ - aim_im_puticbm(&bs, cookie, 0x0004, sn); + aim_im_puticbm(&bs, cookie, 0x0004, bn); /* * TLV t(0005) @@ -1246,8 +1246,8 @@ guchar cookie[8]; guint16 channel; GSList *tlvlist; - char *sn; - int snlen; + char *bn; + int bnlen; guint16 icbmflags = 0; guint8 flag1 = 0, flag2 = 0; gchar *msg = NULL; @@ -1264,8 +1264,8 @@ return 0; } - snlen = byte_stream_get8(bs); - sn = byte_stream_getstr(bs, snlen); + bnlen = byte_stream_get8(bs); + bn = byte_stream_getstr(bs, bnlen); tlvlist = aim_tlvlist_read(bs); @@ -1296,9 +1296,9 @@ } if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) - ret = userfunc(od, conn, frame, channel, sn, msg, icbmflags, flag1, flag2); - - g_free(sn); + ret = userfunc(od, conn, frame, channel, bn, msg, icbmflags, flag1, flag2); + + g_free(bn); g_free(msg); aim_tlvlist_free(tlvlist); @@ -1480,7 +1480,7 @@ msglen = byte_stream_get16(&mbs); if (msglen > byte_stream_empty(&mbs)) { - purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn); + purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->bn); break; } @@ -1588,7 +1588,7 @@ if (length > byte_stream_empty(bs)) { - purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn); + purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->bn); break; } @@ -1611,7 +1611,7 @@ args.featureslen = byte_stream_get16(bs); if (args.featureslen > byte_stream_empty(bs)) { - purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn); + purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->bn); break; } if (args.featureslen == 0) @@ -1686,7 +1686,7 @@ if (length > byte_stream_empty(bs)) { - purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn); + purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->bn); break; } g_free(args.extdata); @@ -1761,7 +1761,7 @@ bnlen = byte_stream_get16(servdata); bn = byte_stream_getstr(servdata, bnlen); - purple_debug_misc("oscar", "got a buddy list from %s: group %s, buddy %s\n", userinfo->sn, gn, bn); + purple_debug_misc("oscar", "got a buddy list from %s: group %s, buddy %s\n", userinfo->bn, gn, bn); g_free(bn); } @@ -2250,7 +2250,7 @@ } /* - * Subtype 0x0008 - Send a warning to sn. + * Subtype 0x0008 - Send a warning to bn. * * Flags: * AIM_WARN_ANON Send as an anonymous (doesn't count as much) @@ -2258,21 +2258,21 @@ * returns -1 on error (couldn't alloc packet), 0 on success. * */ -int aim_im_warn(OscarData *od, FlapConnection *conn, const char *sn, guint32 flags) +int aim_im_warn(OscarData *od, FlapConnection *conn, const char *bn, guint32 flags) { ByteStream bs; aim_snacid_t snacid; - if (!od || !conn || !sn) + if (!od || !conn || !bn) return -EINVAL; - byte_stream_new(&bs, strlen(sn)+3); - - snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0008, 0x0000, sn, strlen(sn)+1); + byte_stream_new(&bs, strlen(bn)+3); + + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0008, 0x0000, bn, strlen(bn)+1); byte_stream_put16(&bs, (flags & AIM_WARN_ANON) ? 0x0001 : 0x0000); - byte_stream_put8(&bs, strlen(sn)); - byte_stream_putstr(&bs, sn); + byte_stream_put8(&bs, strlen(bn)); + byte_stream_putstr(&bs, bn); flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0008, 0x0000, snacid, &bs); @@ -2314,7 +2314,7 @@ * AIM_TRANSFER_DENY_NOTACCEPTING -- "client is not accepting transfers" * */ -int aim_im_denytransfer(OscarData *od, const char *sn, const guchar *cookie, guint16 code) +int aim_im_denytransfer(OscarData *od, const char *bn, const guchar *cookie, guint16 code) { FlapConnection *conn; ByteStream bs; @@ -2324,15 +2324,15 @@ if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; - byte_stream_new(&bs, 8+2+1+strlen(sn)+6); + byte_stream_new(&bs, 8+2+1+strlen(bn)+6); snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x000b, 0x0000, NULL, 0); byte_stream_putraw(&bs, cookie, 8); byte_stream_put16(&bs, 0x0002); /* channel */ - byte_stream_put8(&bs, strlen(sn)); - byte_stream_putstr(&bs, sn); + byte_stream_put8(&bs, strlen(bn)); + byte_stream_putstr(&bs, bn); aim_tlvlist_add_16(&tlvlist, 0x0003, code); aim_tlvlist_write(&bs, &tlvlist); @@ -2345,7 +2345,7 @@ return 0; } -static void parse_status_note_text(OscarData *od, guchar *cookie, char *sn, ByteStream *bs) +static void parse_status_note_text(OscarData *od, guchar *cookie, char *bn, ByteStream *bs) { struct aim_icq_info *info; struct aim_icq_info *prev_info; @@ -2499,10 +2499,10 @@ g_free(status_note_text); g_free(stripped_status_note_text); - buddy = purple_find_buddy(account, sn); + buddy = purple_find_buddy(account, bn); if (buddy == NULL) { - purple_debug_misc("oscar", "clientautoresp: buddy %s was not found.\n", sn); + purple_debug_misc("oscar", "clientautoresp: buddy %s was not found.\n", bn); g_free(status_note); return; } @@ -2513,7 +2513,7 @@ presence = purple_buddy_get_presence(buddy); status = purple_presence_get_active_status(presence); - purple_prpl_got_user_status(account, sn, + purple_prpl_got_user_status(account, bn, purple_status_get_id(status), "message", status_note, NULL); @@ -2530,26 +2530,26 @@ int ret = 0; aim_rxcallback_t userfunc; guint16 channel, reason; - char *sn; + char *bn; guchar *cookie; - guint8 snlen; + guint8 bnlen; cookie = byte_stream_getraw(bs, 8); channel = byte_stream_get16(bs); - snlen = byte_stream_get8(bs); - sn = byte_stream_getstr(bs, snlen); + bnlen = byte_stream_get8(bs); + bn = byte_stream_getstr(bs, bnlen); reason = byte_stream_get16(bs); if (channel == 0x0002) { if (reason == 0x0003) /* channel-specific */ /* parse status note text */ - parse_status_note_text(od, cookie, sn, bs); + parse_status_note_text(od, cookie, bn, bs); byte_stream_get16(bs); /* Unknown */ byte_stream_get16(bs); /* Unknown */ if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) - ret = userfunc(od, conn, frame, channel, sn, reason, cookie); + ret = userfunc(od, conn, frame, channel, bn, reason, cookie); } else if (channel == 0x0004) { /* ICQ message */ switch (reason) { @@ -2594,20 +2594,20 @@ msg = byte_stream_getraw(bs, len); if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) - ret = userfunc(od, conn, frame, channel, sn, reason, state, msg); + ret = userfunc(od, conn, frame, channel, bn, reason, state, msg); g_free(msg); } break; default: { if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) - ret = userfunc(od, conn, frame, channel, sn, reason); + ret = userfunc(od, conn, frame, channel, bn, reason); } break; } /* end switch */ } g_free(cookie); - g_free(sn); + g_free(bn); return ret; } @@ -2625,17 +2625,17 @@ aim_rxcallback_t userfunc; guint16 ch; guchar *cookie; - char *sn; + char *bn; int ret = 0; cookie = byte_stream_getraw(bs, 8); ch = byte_stream_get16(bs); - sn = byte_stream_getstr(bs, byte_stream_get8(bs)); + bn = byte_stream_getstr(bs, byte_stream_get8(bs)); if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) - ret = userfunc(od, conn, frame, ch, sn); - - g_free(sn); + ret = userfunc(od, conn, frame, ch, bn); + + g_free(bn); g_free(cookie); return ret; @@ -2672,7 +2672,7 @@ * and Purple 0.60 and newer. * */ -int aim_im_sendmtn(OscarData *od, guint16 type1, const char *sn, guint16 type2) +int aim_im_sendmtn(OscarData *od, guint16 type1, const char *bn, guint16 type2) { FlapConnection *conn; ByteStream bs; @@ -2681,10 +2681,10 @@ if (!od || !(conn = flap_connection_findbygroup(od, 0x0002))) return -EINVAL; - if (!sn) + if (!bn) return -EINVAL; - byte_stream_new(&bs, 11+strlen(sn)+2); + byte_stream_new(&bs, 11+strlen(bn)+2); snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0014, 0x0000, NULL, 0); @@ -2703,10 +2703,10 @@ byte_stream_put16(&bs, type1); /* - * Dest sn + * Dest buddy name */ - byte_stream_put8(&bs, strlen(sn)); - byte_stream_putstr(&bs, sn); + byte_stream_put8(&bs, strlen(bn)); + byte_stream_putstr(&bs, bn); /* * Type 2 (should be 0x0000, 0x0001, or 0x0002 for mtn) @@ -2731,20 +2731,20 @@ { int ret = 0; aim_rxcallback_t userfunc; - char *sn; - guint8 snlen; + char *bn; + guint8 bnlen; guint16 type1, type2; byte_stream_advance(bs, 8); /* Unknown - All 0's */ type1 = byte_stream_get16(bs); - snlen = byte_stream_get8(bs); - sn = byte_stream_getstr(bs, snlen); + bnlen = byte_stream_get8(bs); + bn = byte_stream_getstr(bs, bnlen); type2 = byte_stream_get16(bs); if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) - ret = userfunc(od, conn, frame, type1, sn, type2); - - g_free(sn); + ret = userfunc(od, conn, frame, type1, bn, type2); + + g_free(bn); return ret; }