summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2017-10-17 17:17:35 -0300
committerdequis <dx@dxzone.com.ar>2017-10-17 17:17:35 -0300
commit553593d07170d6d1563d0079dbedd481dcec5b00 (patch)
tree5c8ffb229fef239a07c89bb4b17d78f548c67974
parent24db488909604dd389b584c1f1ce43c549648dbe (diff)
downloadbitlbee-facebook-553593d07170d6d1563d0079dbedd481dcec5b00.tar.gz
Load is_work through FbData, fixes api key issues after the first login.
I have no idea what request after login requires api keys, though. This plugin signs all post-login requests pointlessly.
-rw-r--r--facebook/facebook-api.c17
-rw-r--r--facebook/facebook-data.c8
2 files changed, 25 insertions, 0 deletions
diff --git a/facebook/facebook-api.c b/facebook/facebook-api.c
index 27a8aab..16bbf6e 100644
--- a/facebook/facebook-api.c
+++ b/facebook/facebook-api.c
@@ -40,6 +40,7 @@ enum
PROP_TOKEN,
PROP_UID,
PROP_TWEAK,
+ PROP_WORK,
PROP_N
};
@@ -155,6 +156,9 @@ fb_api_set_property(GObject *obj, guint prop, const GValue *val,
priv->tweak = g_value_get_int(val);
fb_http_set_agent(priv->http, fb_api_get_agent_string(priv->tweak, 0));
break;
+ case PROP_WORK:
+ priv->is_work = g_value_get_boolean(val);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop, pspec);
@@ -189,6 +193,9 @@ fb_api_get_property(GObject *obj, guint prop, GValue *val, GParamSpec *pspec)
case PROP_TWEAK:
g_value_set_int(val, priv->tweak);
break;
+ case PROP_WORK:
+ g_value_set_boolean(val, priv->is_work);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop, pspec);
@@ -321,6 +328,16 @@ fb_api_class_init(FbApiClass *klass)
"",
0, G_MAXINT, 0,
G_PARAM_READWRITE);
+
+ /**
+ * FbApi:work:
+ */
+ props[PROP_WORK] = g_param_spec_boolean(
+ "work",
+ "Work",
+ "",
+ FALSE,
+ G_PARAM_READWRITE);
g_object_class_install_properties(gklass, PROP_N, props);
/**
diff --git a/facebook/facebook-data.c b/facebook/facebook-data.c
index 99cd5e5..608d725 100644
--- a/facebook/facebook-data.c
+++ b/facebook/facebook-data.c
@@ -169,6 +169,14 @@ fb_data_load(FbData *fata)
g_value_unset(&val);
}
+ num = set_getbool(&acct->set, "work");
+ if (num != 0) {
+ g_value_init(&val, G_TYPE_BOOLEAN);
+ g_value_set_boolean(&val, num);
+ g_object_set_property(G_OBJECT(priv->api), "work", &val);
+ g_value_unset(&val);
+ }
+
fb_api_rehash(priv->api);
return ret;
}