diff options
author | Eion Robb <eion@robbmob.com> | 2016-01-07 23:43:57 +0300 |
---|---|---|
committer | Eion Robb <eion@robbmob.com> | 2016-01-07 23:43:57 +0300 |
commit | eb9016b7e7ca0c644a39f592660f7d4f6a99b819 (patch) | |
tree | 7386ccde5cf5abc67a22dbc61078063334590352 /steam-mobile | |
parent | ef6215fb1c709db4d858c8c46dbc026c1e0fef68 (diff) |
Ignore invites from groups/clans
Diffstat (limited to 'steam-mobile')
-rw-r--r-- | steam-mobile/libsteam.c | 27 | ||||
-rw-r--r-- | steam-mobile/libsteam.h | 1 |
2 files changed, 18 insertions, 10 deletions
diff --git a/steam-mobile/libsteam.c b/steam-mobile/libsteam.c index fef1dce..e240aa5 100644 --- a/steam-mobile/libsteam.c +++ b/steam-mobile/libsteam.c @@ -598,16 +598,19 @@ steam_poll_cb(SteamAccount *sa, JsonObject *obj, gpointer user_data) {
const gchar *steamid = json_object_get_string_member(message, "steamid_from");
gint64 persona_state = json_object_get_int_member(message, "persona_state");
- if (persona_state == 0)
- purple_blist_remove_buddy(purple_find_buddy(sa->account, steamid));
- else if (persona_state == 2)
- purple_account_request_authorization(
- sa->account, steamid, NULL,
- NULL, NULL, TRUE,
- steam_auth_accept_cb, steam_auth_reject_cb, purple_buddy_new(sa->account, steamid, NULL));
- else if (persona_state == 3)
- if (!purple_find_buddy(sa->account, steamid))
- purple_blist_add_buddy(purple_buddy_new(sa->account, steamid, NULL), NULL, purple_find_group("Steam"), NULL);
+
+ if (!STEAMID_IS_GROUP(steamid)) {
+ if (persona_state == 0)
+ purple_blist_remove_buddy(purple_find_buddy(sa->account, steamid));
+ else if (persona_state == 2)
+ purple_account_request_authorization(
+ sa->account, steamid, NULL,
+ NULL, NULL, TRUE,
+ steam_auth_accept_cb, steam_auth_reject_cb, purple_buddy_new(sa->account, steamid, NULL));
+ else if (persona_state == 3)
+ if (!purple_find_buddy(sa->account, steamid))
+ purple_blist_add_buddy(purple_buddy_new(sa->account, steamid, NULL), NULL, purple_find_group("Steam"), NULL);
+ }
} else if (g_str_equal(type, "leftconversation"))
{
const gchar *steamid = json_object_get_string_member(message, "steamid_from");
@@ -806,6 +809,10 @@ steam_get_friend_list_cb(SteamAccount *sa, JsonObject *obj, gpointer user_data) JsonObject *friend = json_array_get_object_element(friends, index);
const gchar *steamid = json_object_get_string_member(friend, "steamid");
const gchar *relationship = json_object_get_string_member(friend, "relationship");
+
+ if (STEAMID_IS_GROUP(steamid))
+ continue;
+
if (g_str_equal(relationship, "friend"))
{
if (!purple_find_buddy(sa->account, steamid))
diff --git a/steam-mobile/libsteam.h b/steam-mobile/libsteam.h index 5cc83f1..8e5fabc 100644 --- a/steam-mobile/libsteam.h +++ b/steam-mobile/libsteam.h @@ -116,5 +116,6 @@ struct _SteamBuddy { gchar *gameserverip; }; +#define STEAMID_IS_GROUP(id) G_UNLIKELY((((id) >> 52) & 0x0F) == 7) #endif /* LIBSTEAM_H */ |