示例#1
0
void
msn_transaction_queue_cmd(MsnTransaction *trans, MsnCommand *cmd)
{
	purple_debug_info("msn", "queueing command.\n");
	trans->pendent_cmd = cmd;
	msn_command_ref(cmd);
}
示例#2
0
MsnCommand *
msn_command_from_string(const char *string)
{
	MsnCommand *cmd;
	char *tmp;
	char *param_start;

	g_return_val_if_fail(string != NULL, NULL);

	tmp = g_strdup(string);
	param_start = strchr(tmp, ' ');

	cmd = g_new0(MsnCommand, 1);
	cmd->command = tmp;

        /** @todo check string "preferredEmail: " */

        if (param_start)
	{
		*param_start++ = '\0';
		cmd->params = g_strsplit(param_start, " ", 0);
	}

	if (cmd->params != NULL && cmd->params[0] != NULL)
	{
		char *param;
		int c;

		for (c = 0; cmd->params[c]; c++);
		cmd->param_count = c;

		param = cmd->params[0];

		cmd->trId = is_num(param) ? atoi(param) : 0;
	}
	else
		cmd->trId = 0;

	msn_command_ref(cmd);

	return cmd;
}