Example #1
0
void
msn_session_finish_login(MsnSession *session)
{
	PurpleAccount *account;
	PurpleConnection *gc;
	PurpleImage *img;

	if (!session->logged_in) {
		account = session->account;
		gc = purple_account_get_connection(account);

		img = purple_buddy_icons_find_account_icon(session->account);
		/* TODO: Do we really want to call this if img is NULL? */
		msn_user_set_buddy_icon(session->user, img);
		if (img != NULL)
			g_object_unref(img);

		session->logged_in = TRUE;
		purple_connection_set_state(gc, PURPLE_CONNECTION_CONNECTED);

		/* Sync users */
		msn_session_sync_users(session);
	}

	/* TODO: Send this when updating status instead? */
	msn_notification_send_uux_endpointdata(session);
	msn_notification_send_uux_private_endpointdata(session);

	msn_change_status(session);
}
Example #2
0
void
msn_session_finish_login(MsnSession *session)
{
	PurpleAccount *account;
	PurpleConnection *gc;
	PurpleStoredImage *img;

	if (!session->logged_in) {
		account = session->account;
		gc = purple_account_get_connection(account);

		img = purple_buddy_icons_find_account_icon(session->account);
		/* TODO: Do we really want to call this if img is NULL? */
		msn_user_set_buddy_icon(session->user, img);
		if (img != NULL)
			purple_imgstore_unref(img);

		session->logged_in = TRUE;
		purple_connection_set_state(gc, PURPLE_CONNECTED);

		/* Sync users */
		msn_session_sync_users(session);
	}

	msn_change_status(session);
}
Example #3
0
void
msn_session_finish_login(MsnSession *session)
{
	PurpleAccount *account;
	PurpleConnection *gc;
	PurpleStoredImage *img;
	const char *passport;

	if (session->logged_in) {
		/* We are probably here because of a mid-session notification server XFR
		 * We must send a CHG now, otherwise the servers default to invisible,
		 * and prevent things happening, like sending IMs */
		msn_change_status(session);
		return;
	}

	account = session->account;
	gc = purple_account_get_connection(account);

	img = purple_buddy_icons_find_account_icon(session->account);
	msn_user_set_buddy_icon(session->user, img);
	purple_imgstore_unref(img);

	session->logged_in = TRUE;

	msn_change_status(session);

	purple_connection_set_state(gc, PURPLE_CONNECTED);

	/* Sync users */
	msn_session_sync_users(session);
	/* It seems that some accounts that haven't accessed hotmail for a while
	 * and @msn.com accounts don't automatically get the initial email
	 * notification so we always request it on login
	 */

	passport = purple_normalize(account, purple_account_get_username(account));

	if ((strstr(passport, "@hotmail.") != NULL) ||
		(strstr(passport, "@msn.com") != NULL))
	{
		msn_cmdproc_send(session->notification->cmdproc, "URL", "%s", "INBOX");
	}
}
Example #4
0
void
msn_session_finish_login(MsnSession *session)
{
	PurpleAccount *account;
	PurpleConnection *gc;
	PurpleStoredImage *img;
	const char *passport;

	if (session->logged_in)
		return;

	account = session->account;
	gc = purple_account_get_connection(account);

	img = purple_buddy_icons_find_account_icon(session->account);
	msn_user_set_buddy_icon(session->user, img);
	purple_imgstore_unref(img);

	session->logged_in = TRUE;

	msn_change_status(session);

	purple_connection_set_state(gc, PURPLE_CONNECTED);

	/* Sync users */
	msn_session_sync_users(session);
	/* It seems that some accounts that haven't accessed hotmail for a while
	 * and @msn.com accounts don't automatically get the initial email
	 * notification so we always request it on login
	 */

	passport = purple_normalize(account, purple_account_get_username(account));

	if ((strstr(passport, "@hotmail.") != NULL) ||
		(strstr(passport, "@msn.com") != NULL))
	{
		msn_cmdproc_send(session->notification->cmdproc, "URL", "%s", "INBOX");
	}
}