pidgin/pidgin

merging
replace-nm-with-gio
2015-12-28, Gary Kramlich
849d12200039
merging
--- a/libpurple/data/purple-3.pc.in Mon Dec 28 21:54:46 2015 -0600
+++ b/libpurple/data/purple-3.pc.in Mon Dec 28 21:56:53 2015 -0600
@@ -5,7 +5,6 @@
datarootdir=@datarootdir@
datadir=@datadir@
sysconfdir=@sysconfdir@
-gstreamer=@GSTREAMER_VER@
plugindir=${libdir}/purple-@PURPLE_MAJOR_VERSION@
--- a/libpurple/protocols/facebook/api.c Mon Dec 28 21:54:46 2015 -0600
+++ b/libpurple/protocols/facebook/api.c Mon Dec 28 21:56:53 2015 -0600
@@ -1941,8 +1941,10 @@
{
const gchar *str;
FbApi *api = data;
+ FbApiPrivate *priv = api->priv;
FbApiUser *user;
FbHttpParams *prms;
+ FbId uid;
FbJsonValues *values;
gboolean complete;
gchar *writeid = NULL;
@@ -1959,9 +1961,9 @@
fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE,
"$.graph_api_write_id");
fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE,
- "$.represented_profile.friendship_status");
+ "$.represented_profile.id");
fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE,
- "$.represented_profile.id");
+ "$.represented_profile.friendship_status");
fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE,
"$.structured_name.text");
fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE,
@@ -1972,17 +1974,20 @@
while (fb_json_values_update(values, &err)) {
g_free(writeid);
writeid = fb_json_values_next_str_dup(values, NULL);
+ count++;
+
+ str = fb_json_values_next_str(values, "0");
+ uid = FB_ID_FROM_STR(str);
str = fb_json_values_next_str(values, NULL);
- count++;
-
- if (!purple_strequal(str, "ARE_FRIENDS")) {
+
+ if (!purple_strequal(str, "ARE_FRIENDS") &&
+ (uid != priv->uid))
+ {
continue;
}
user = fb_api_user_dup(NULL, FALSE);
- str = fb_json_values_next_str(values, "0");
-
- user->uid = FB_ID_FROM_STR(str);
+ user->uid = uid;
user->name = fb_json_values_next_str_dup(values, NULL);
user->icon = fb_json_values_next_str_dup(values, NULL);
--- a/libpurple/protocols/facebook/facebook.c Mon Dec 28 21:54:46 2015 -0600
+++ b/libpurple/protocols/facebook/facebook.c Mon Dec 28 21:56:53 2015 -0600
@@ -462,6 +462,7 @@
const gchar *text;
FbApiMessage *msg;
FbData *fata = data;
+ gboolean isself;
gboolean mark;
gboolean open;
gboolean self;
@@ -480,6 +481,7 @@
acct = purple_connection_get_account(gc);
mark = purple_account_get_bool(acct, "mark-read", TRUE);
open = purple_account_get_bool(acct, "group-chat-open", TRUE);
+ self = purple_account_get_bool(acct, "show-self", TRUE);
for (l = msgs; l != NULL; l = l->next) {
msg = l->data;
@@ -492,8 +494,13 @@
continue;
}
- self = (msg->flags & FB_API_MESSAGE_FLAG_SELF) != 0;
- flags = self ? PURPLE_MESSAGE_SEND : PURPLE_MESSAGE_RECV;
+ isself = (msg->flags & FB_API_MESSAGE_FLAG_SELF) != 0;
+
+ if (isself && !self) {
+ continue;
+ }
+
+ flags = isself ? PURPLE_MESSAGE_SEND : PURPLE_MESSAGE_RECV;
tstamp = msg->tstamp / 1000;
if (msg->flags & FB_API_MESSAGE_FLAG_IMAGE) {
@@ -515,7 +522,7 @@
}
if (msg->tid == 0) {
- if (mark && !self) {
+ if (mark && !isself) {
fb_data_set_unread(fata, msg->uid, TRUE);
}
@@ -540,7 +547,7 @@
id = purple_chat_conversation_get_id(chat);
}
- if (mark && !self) {
+ if (mark && !isself) {
fb_data_set_unread(fata, msg->tid, TRUE);
}
@@ -584,6 +591,7 @@
{
FbApiUser *user;
FbData *fata = data;
+ gboolean active;
gchar tid[FB_ID_STRMAX];
gchar uid[FB_ID_STRMAX];
gint id;
@@ -598,8 +606,9 @@
FB_ID_TO_STR(thrd->tid, tid);
chat = purple_conversations_find_chat_with_account(tid, acct);
+ active = (chat != NULL) && !purple_chat_conversation_has_left(chat);
- if (chat == NULL) {
+ if (!active) {
chat = purple_serv_got_joined_chat(gc, id, tid);
}
@@ -617,7 +626,7 @@
fb_buddy_add_nonfriend(acct, user);
}
- purple_chat_conversation_add_user(chat, uid, NULL, 0, TRUE);
+ purple_chat_conversation_add_user(chat, uid, NULL, 0, active);
}
}
@@ -1153,7 +1162,7 @@
id = fb_id_hash(&tid);
chat = purple_conversations_find_chat(gc, id);
- if (chat != NULL) {
+ if ((chat != NULL) && !purple_chat_conversation_has_left(chat)) {
purple_conversation_present(PURPLE_CONVERSATION(chat));
return;
}
@@ -1404,6 +1413,10 @@
"mark-read", TRUE);
opts = g_list_prepend(opts, opt);
+ opt = purple_account_option_bool_new(_("Show self messages"),
+ "show-self", TRUE);
+ opts = g_list_prepend(opts, opt);
+
opt = purple_account_option_bool_new(_("Show unread messages"),
"show-unread", TRUE);
opts = g_list_prepend(opts, opt);
--- a/libpurple/protocols/facebook/http.c Mon Dec 28 21:54:46 2015 -0600
+++ b/libpurple/protocols/facebook/http.c Mon Dec 28 21:56:53 2015 -0600
@@ -152,11 +152,11 @@
if (isurl) {
data = strchr(data, '?');
- if (data++ == NULL) {
+ if (data == NULL) {
return params;
}
- tail = strchr(data, '#');
+ tail = strchr(++data, '#');
if (tail != NULL) {
data = g_strndup(data, tail - data);
--- a/libpurple/protocols/facebook/mqtt.c Mon Dec 28 21:54:46 2015 -0600
+++ b/libpurple/protocols/facebook/mqtt.c Mon Dec 28 21:56:53 2015 -0600
@@ -469,6 +469,7 @@
}
if (!fb_mqtt_message_read_mid(msg, &mid)) {
+ g_free(str);
break;
}