/*
 * Subtype 0x0009
 *
 * Since multiple things can trigger this callback, we must lookup the
 * snacid to determine the original snac subtype that was called.
 *
 * XXX This isn't really how this works.  But this is:  Every d/9 response
 * has a 16bit value at the beginning. That matches to:
 *    Short Desc = 1
 *    Full Desc = 2
 *    Instance Info = 4
 *    Nav Short Desc = 8
 *    Nav Instance Info = 16
 * And then everything is really asynchronous.  There is no specific
 * attachment of a response to a create room request, for example.  Creating
 * the room yields no different a response than requesting the room's info.
 *
 */
static int
parseinfo(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
{
	aim_snac_t *snac2;
	int ret = 0;

	if (!(snac2 = aim_remsnac(od, snac->id))) {
		purple_debug_misc("oscar", "faim: chatnav_parse_info: received response to unknown request! (%08x)\n", snac->id);
		return 0;
	}

	if (snac2->family != SNAC_FAMILY_CHATNAV) {
		purple_debug_misc("oscar", "faim: chatnav_parse_info: received response that maps to corrupt request! (fam=%04x)\n", snac2->family);
		g_free(snac2->data);
		g_free(snac2);
		return 0;
	}

	/*
	 * We now know what the original SNAC subtype was.
	 */
	if (snac2->type == 0x0002) /* request chat rights */
		ret = parseinfo_perms(od, conn, mod, frame, snac, bs, snac2);
	else if (snac2->type == 0x0003) /* request exchange info */
		purple_debug_misc("oscar", "chatnav_parse_info: response to exchange info\n");
	else if (snac2->type == 0x0004) /* request room info */
		purple_debug_misc("oscar", "chatnav_parse_info: response to room info\n");
	else if (snac2->type == 0x0005) /* request more room info */
		purple_debug_misc("oscar", "chatnav_parse_info: response to more room info\n");
	else if (snac2->type == 0x0006) /* request occupant list */
		purple_debug_misc("oscar", "chatnav_parse_info: response to occupant info\n");
	else if (snac2->type == 0x0007) /* search for a room */
		purple_debug_misc("oscar", "chatnav_parse_info: search results\n");
	else if (snac2->type == 0x0008) /* create room */
		ret = parseinfo_create(od, conn, mod, frame, snac, bs, snac2);
	else
		purple_debug_misc("oscar", "chatnav_parse_info: unknown request subtype (%04x)\n", snac2->type);

	if (snac2)
		g_free(snac2->data);
	g_free(snac2);

	return ret;
}
示例#2
0
/*
 * Since multiple things can trigger this callback, we must lookup the 
 * snacid to determine the original snac subtype that was called.
 *
 * XXX This isn't really how this works.  But this is:  Every d/9 response
 * has a 16bit value at the beginning. That matches to:
 *    Short Desc = 1
 *    Full Desc = 2
 *    Instance Info = 4
 *    Nav Short Desc = 8
 *    Nav Instance Info = 16
 * And then everything is really asynchronous.  There is no specific 
 * attachment of a response to a create room request, for example.  Creating
 * the room yields no different a response than requesting the room's info.
 *
 */
static int parseinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
{
	aim_snac_t *snac2;
	int ret = 0;

	if (!(snac2 = aim_remsnac(sess, snac->id))) {
		faimdprintf(sess, 0, "faim: chatnav_parse_info: received response to unknown request! (%08lx)\n", snac->id);
		return 0;
	}

	if (snac2->family != 0x000d) {
		faimdprintf(sess, 0, "faim: chatnav_parse_info: recieved response that maps to corrupt request! (fam=%04x)\n", snac2->family);
		return 0;
	}

	/*
	 * We now know what the original SNAC subtype was.
	 */
	if (snac2->type == 0x0002) /* request chat rights */
		ret = parseinfo_perms(sess, mod, rx, snac, bs, snac2);
	else if (snac2->type == 0x0003) /* request exchange info */
		faimdprintf(sess, 0, "chatnav_parse_info: resposne to exchange info\n");
	else if (snac2->type == 0x0004) /* request room info */
		faimdprintf(sess, 0, "chatnav_parse_info: response to room info\n");
	else if (snac2->type == 0x0005) /* request more room info */
		faimdprintf(sess, 0, "chatnav_parse_info: response to more room info\n");
	else if (snac2->type == 0x0006) /* request occupant list */
		faimdprintf(sess, 0, "chatnav_parse_info: response to occupant info\n");
	else if (snac2->type == 0x0007) /* search for a room */
		faimdprintf(sess, 0, "chatnav_parse_info: search results\n");
	else if (snac2->type == 0x0008) /* create room */
		ret = parseinfo_create(sess, mod, rx, snac, bs, snac2);
	else
		faimdprintf(sess, 0, "chatnav_parse_info: unknown request subtype (%04x)\n", snac2->type);

	if (snac2)
		free(snac2->data);
	free(snac2);

	return ret;
}
示例#3
0
/*
 * Since multiple things can trigger this callback, we must lookup the 
 * snacid to determine the original snac subtype that was called.
 *
 * XXX This isn't really how this works.  But this is:  Every d/9 response
 * has a 16bit value at the beginning. That matches to:
 *    Short Desc = 1
 *    Full Desc = 2
 *    Instance Info = 4
 *    Nav Short Desc = 8
 *    Nav Instance Info = 16
 * And then everything is really asynchronous.  There is no specific 
 * attachment of a response to a create room request, for example.  Creating
 * the room yields no different a response than requesting the room's info.
 *
 */
static int parseinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
{
	aim_snac_t *snac2;
	int ret = 0;

	if (!(snac2 = aim_remsnac(sess, snac->id))) {
		imcb_error(sess->aux_data, "received response to unknown request!");
		return 0;
	}

	if (snac2->family != 0x000d) {
		imcb_error(sess->aux_data, "recieved response that maps to corrupt request!");
		return 0;
	}

	/*
	 * We now know what the original SNAC subtype was.
	 */
	if (snac2->type == 0x0002) /* request chat rights */
		ret = parseinfo_perms(sess, mod, rx, snac, bs, snac2);
	else if (snac2->type == 0x0003) {} /* request exchange info */
	else if (snac2->type == 0x0004) {} /* request room info */
	else if (snac2->type == 0x0005) {} /* request more room info */
	else if (snac2->type == 0x0006) {} /* request occupant list */
	else if (snac2->type == 0x0007) {} /* search for a room */
	else if (snac2->type == 0x0008) /* create room */
		ret = parseinfo_create(sess, mod, rx, snac, bs, snac2);
	else
		imcb_error(sess->aux_data, "unknown request subtype");

	if (snac2)
		g_free(snac2->data);
	g_free(snac2);

	return ret;
}