| 1424 |
1424 |
| 1425 static GSList * |
1425 static GSList * |
| 1426 fb_api_cb_publish_ms_event(FbApi *api, JsonNode *root, GSList *events, FbApiEventType type, GError **error); |
1426 fb_api_cb_publish_ms_event(FbApi *api, JsonNode *root, GSList *events, FbApiEventType type, GError **error); |
| 1427 |
1427 |
| 1428 static void |
1428 static void |
| |
1429 fb_api_cb_publish_mst(FbThrift *thft, GError **error) |
| |
1430 { |
| |
1431 if (fb_thrift_read_isstop(thft)) { |
| |
1432 FB_API_TCHK(fb_thrift_read_stop(thft)); |
| |
1433 } else { |
| |
1434 FbThriftType type; |
| |
1435 gint16 id; |
| |
1436 |
| |
1437 FB_API_TCHK(fb_thrift_read_field(thft, &type, &id, 0)); |
| |
1438 FB_API_TCHK(type == FB_THRIFT_TYPE_STRING); |
| |
1439 // FB_API_TCHK(id == 2); |
| |
1440 FB_API_TCHK(fb_thrift_read_str(thft, NULL)); |
| |
1441 FB_API_TCHK(fb_thrift_read_stop(thft)); |
| |
1442 } |
| |
1443 } |
| |
1444 |
| |
1445 static void |
| 1429 fb_api_cb_publish_ms(FbApi *api, GByteArray *pload) |
1446 fb_api_cb_publish_ms(FbApi *api, GByteArray *pload) |
| 1430 { |
1447 { |
| 1431 const gchar *data; |
1448 const gchar *data; |
| 1432 FbApiPrivate *priv = api->priv; |
1449 FbApiPrivate *priv = api->priv; |
| 1433 FbJsonValues *values; |
1450 FbJsonValues *values; |
| 1453 {"deltaParticipantLeftGroupThread", FB_API_EVENT_TYPE_THREAD_USER_REMOVED, 0}, |
1470 {"deltaParticipantLeftGroupThread", FB_API_EVENT_TYPE_THREAD_USER_REMOVED, 0}, |
| 1454 }; |
1471 }; |
| 1455 |
1472 |
| 1456 /* Read identifier string (for Facebook employees) */ |
1473 /* Read identifier string (for Facebook employees) */ |
| 1457 thft = fb_thrift_new(pload, 0); |
1474 thft = fb_thrift_new(pload, 0); |
| 1458 fb_thrift_read_str(thft, NULL); |
1475 fb_api_cb_publish_mst(thft, &err); |
| 1459 size = fb_thrift_get_pos(thft); |
1476 size = fb_thrift_get_pos(thft); |
| 1460 g_object_unref(thft); |
1477 g_object_unref(thft); |
| |
1478 |
| |
1479 FB_API_ERROR_EMIT(api, err, |
| |
1480 return; |
| |
1481 ); |
| 1461 |
1482 |
| 1462 g_return_if_fail(size < pload->len); |
1483 g_return_if_fail(size < pload->len); |
| 1463 data = (gchar *) pload->data + size; |
1484 data = (gchar *) pload->data + size; |
| 1464 size = pload->len - size; |
1485 size = pload->len - size; |
| 1465 |
1486 |
| 1766 pres = fb_api_presence_dup(NULL); |
1787 pres = fb_api_presence_dup(NULL); |
| 1767 pres->uid = i64; |
1788 pres->uid = i64; |
| 1768 pres->active = i32 != 0; |
1789 pres->active = i32 != 0; |
| 1769 *press = g_slist_prepend(*press, pres); |
1790 *press = g_slist_prepend(*press, pres); |
| 1770 |
1791 |
| 1771 fb_util_debug_info("Presence: %" FB_ID_FORMAT " (%d)", |
1792 fb_util_debug_info("Presence: %" FB_ID_FORMAT " (%d) id: %d", |
| 1772 i64, i32 != 0); |
1793 i64, i32 != 0, id); |
| 1773 |
1794 |
| 1774 while (id <= 5) { |
1795 while (id <= 6) { |
| 1775 if (fb_thrift_read_isstop(thft)) { |
1796 if (fb_thrift_read_isstop(thft)) { |
| 1776 break; |
1797 break; |
| 1777 } |
1798 } |
| 1778 |
1799 |
| 1779 FB_API_TCHK(fb_thrift_read_field(thft, &type, &id, id)); |
1800 FB_API_TCHK(fb_thrift_read_field(thft, &type, &id, id)); |
| 1816 /* Read the field stop */ |
1837 /* Read the field stop */ |
| 1817 FB_API_TCHK(fb_thrift_read_stop(thft)); |
1838 FB_API_TCHK(fb_thrift_read_stop(thft)); |
| 1818 } |
1839 } |
| 1819 |
1840 |
| 1820 /* Read the field stop */ |
1841 /* Read the field stop */ |
| 1821 FB_API_TCHK(fb_thrift_read_stop(thft)); |
1842 if (fb_thrift_read_isstop(thft)) { |
| |
1843 FB_API_TCHK(fb_thrift_read_stop(thft)); |
| |
1844 } |
| 1822 } |
1845 } |
| 1823 |
1846 |
| 1824 static void |
1847 static void |
| 1825 fb_api_cb_publish_p(FbApi *api, GByteArray *pload) |
1848 fb_api_cb_publish_p(FbApi *api, GByteArray *pload) |
| 1826 { |
1849 { |