Skip to content

Commit

Permalink
Handle onLogOff in steampurple
Browse files Browse the repository at this point in the history
  • Loading branch information
seishun committed Aug 24, 2013
1 parent 315a739 commit beae172
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion steampurple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,28 @@ static void steam_login(PurpleAccount* account) {
purple_connection_error_reason(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "This server is down");
break;
default:
purple_debug_error("steam", "Unknown eresult: %i\n", result);
purple_debug_error("steam", "Unknown logon eresult: %i\n", result);
purple_connection_error_reason(pc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, "Unknown error");
}

g_free(steamID_string);
};

steam->client.onLogOff = [pc](EResult result) {
switch (result) {
case EResult::LoggedInElsewhere:
case EResult::LogonSessionReplaced:
purple_connection_error_reason(pc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, "Logged in elsewhere");
break;
case EResult::ServiceUnavailable:
purple_connection_error_reason(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "Steam went down");
break;
default:
purple_debug_error("steam", "Unknown logoff eresult: %i\n", result);
purple_connection_error_reason(pc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, "Unknown error");
}
};

steam->client.onSentry = [account](const unsigned char hash[20]) {
auto base64 = purple_base64_encode(hash, 20);
purple_account_set_string(account, "sentry_hash", base64);
Expand Down

0 comments on commit beae172

Please sign in to comment.