aboutsummaryrefslogtreecommitdiffstats
path: root/facebook
Commit message (Collapse)AuthorAgeLines
...
* facebook-api: implemented queued message sendingjgeboski2016-01-04-25/+93
| | | | | | | | | | | This ensures a message is sent successfully before attempting to send another message. As a result, messages are sent in their proper order, instead of the order in which they arrive. This also introduces a check for the successful sending of a message, rather than silently failing. The queued sending also ensures messages are not lost when the state of visibility is being switched. This also allows the plugin to silently reconnect when a connection failure occurs.
* facebook-api: properly handle optional Thrift fields and scopingjgeboski2016-01-01-85/+132
| | | | | | | | | | | | | | The plugin is required to read Thrift data for the presence states of contacts. The data which is being read has some optional fields, which are rarely not supplied. This has led to this bug being undiscovered for quite some time. Not only was the plugin not properly accounting for optional fields, but also did not account for field scoping. This is not really an issue until a Thrift list is being read, which will cause the identifier to grow with each field read, rather than reset. The field identifier is only relevant to its local scope, nothing more. More importantly, the identifier must be reset with each iteration of a list.
* facebook: fixed a GCC-5 warningjgeboski2015-12-31-1/+1
|
* facebook: allow the 'group_chat_open' set to be assigned to 'all'jgeboski2015-12-31-51/+71
| | | | | | | | | | | | This adds more functionality to the `group_chat_open` set, which would only allow added group chats to be opened automatically. With this new set value of 'all', any group chat will be automatically opened with an incoming message. Value overview: - false: never open group chats automatically - true: open added group chats automatically - all: always open group chats automatically
* facebook-api: fixed the self contact being ignoredjgeboski2015-12-28-7/+12
| | | | This is a regression introduced by 00c0ae8.
* Preserve the timestamp on incoming messagesjgeboski2015-12-26-4/+14
|
* facebook-http: fixed GTK-Doc sectionjgeboski2015-12-26-1/+1
|
* Fixed a few issues reported by Coverityjgeboski2015-12-26-2/+3
|
* Trivial GTK-Doc fixesjgeboski2015-12-25-4/+4
|
* facebook: fixed broken contact counting with non-friendsjgeboski2015-12-25-2/+1
| | | | | | | | | | | | | | | | When fetching more than 500 contacts, multiple requests must be made in order avoid request limits. When friends are retrieved and processed, the plugin must keep a count of the processed contacts to know whether or not it needs to retrieve more contacts. Currently, this counter assumes every contact is a friend, which is not always the case. This counter needs to advance even when a contact is not a friend. This fixes the incomplete fetching of the buddy list when a user has over 500 friends. This is a regression introduced by 00c0ae8.
* Coding style consistenciesjgeboski2015-12-24-19/+19
|
* Dropped required GLib version to 2.28.0jgeboski2015-12-22-20/+63
| | | | This is namely for the RedHat guys maintaining RHEL 6.
* facebook-util: document the FbDebugLevel enumjgeboski2015-12-22-0/+10
|
* facebook-api: fixed faulty conditional with friend checkingjgeboski2015-12-22-1/+1
| | | | This regression was introduced by 00c0ae8.
* facebook-json: fixed a size overflow with string duplicationjgeboski2015-12-20-1/+6
| | | | | | | | | | | Unlike json_parser_load_from_data(), g_strndup() will not handle signed sizes that are negative. This causes the size to overflow to a really large value, and in turn lead to a segmentation fault. The solution is simple: calculate the size of the data when the given size is negative. This bug was introduced by 0121bae.
* facebook-api: fixed non-friend contacts showing as buddiesjgeboski2015-12-20-0/+8
|
* facebook-json:`Special-case "$" to return root for json-glib < 0.99.2dequis2015-12-20-0/+5
| | | | | | | | | | | | | | | | | | | Older glib versions didn't consider "$" to be a valid expression, and threw this error: Root node followed by invalid character ' (That's supposed to be '%c' with a \0) Since this is possibly the simplest expression to parse, a g_strcmp0() can do the job. Thanks to advcomp2019 for reporting this bug and finding a test case where this issue is reproducible every time (receiving events of people joining or leaving in a groupchat) Also thanks to EionRobb who realized what the bug was three hours ago (and I didn't listen because I thought the previous bug was the same)
* facebook-json: Ensure data is null terminated for json-glib < 1.0.2dequis2015-12-20-1/+7
| | | | | | | | | | | | | | | | | Older json-glib versions had a bug[1] in which the length parameter was ignored and this error happened if the input was not null-terminated: JSON data must be UTF-8 encoded Since these versions are expected to still be around in some distros, this commit makes a copy with g_strndup() to ensure that it's always null terminated. Thanks to advcomp2019 for reporting this bug and finding a test case where this issue is reproducible every time (receiving events of people joining or leaving in a groupchat) [1]: https://bugzilla.gnome.org/show_bug.cgi?id=727755
* facebook-util: refactored naming and GTK-Docjgeboski2015-12-20-70/+71
|
* Fixed grammar errors in the GTK-Docjgeboski2015-12-20-41/+41
|
* facebook-util: use the GConverter interface instead of zlibjgeboski2015-12-20-91/+71
|
* mqtt: fix segfaults after disconnecting on writedequis2015-11-19-2/+3
| | | | | | | | | | | | | | | Any call to fb_mqtt_write() can result in an error writing to the socket, which means fb_mqtt_close() can be called and the mqtt object is invalidated. Trying to write priv->tev = 0 at that point is a small invalid write, but not enough to make it crash. The real problem is fb_mqtt_timeout(), which adds a 90 second delay after which it *does* crash, often when a different account already finished logging. The fix here takes advantage of the cleanup done by fb_mqtt_close() - by adding the timeout before that call, it will find a nonzero priv->tev and remove it.
* fb_mqtt_write: fix unreachable input_add (priv->wev was always 0)dequis2015-11-19-2/+1
| | | | | | | | | | | | | This was the only line that assigned anything to priv->wev, and it was behind an (incorrect) condition that checked if it's nonzero. That would have replaced priv->wev if the condition was ever true, but since it wasn't, the only result is potentially delayed writes (for example, filling the write buffer and only writing the rest a minute later when pinging the server) The new condition also checks the return value of fb_mqtt_cb_write(), which is true if it should continue writing, or false otherwise.
* fb_channel_join: add a null check for the "room" channel settingdequis2015-11-01-0/+5
| | | | | | Control channels never have a room setting, so joining to &facebook and trying to fbjoin a channel would result in a null pointer dereference in the next line (FB_ID_TO_STR)
* Show self-messages when there's a compatible bitlbeedequis2015-09-20-3/+16
| | | | | | | | | | | | This feature is not yet in any stable bitlbee release, but it's designed to be backwards compatible: - Run time: Detects if the "self_messages" global setting exists. - Build time: sets OPT_SELFMESSAGE to 0 if it doesn't exist. In other words, if this is built against a bitlbee version that supports this feature, it will still run in anything 3.4+, and only display these messages in the newer ones.
* facebook-api: fix groupchat self messagesdequis2015-09-20-6/+6
| | | | By not swapping uid with oid, since the latter is always 0.
* Handle any away status from bitlbee as 'invisible' for the serverdequis2015-09-15-0/+29
|
* facebook: implemented auto-joining for incoming group chat messagesjgeboski2015-09-13-17/+61
| | | | | | | | | This adds a setting, group_chat_open, which if set to true, will allow the plugin to open added channels upon an incoming message. This also addresses: - Improper message printing for root commands - The fbchats command not joining existing channels
* facebook-data: fixed segfault when clearing the thread listjgeboski2015-09-13-9/+4
| | | | | | | The thread list is not being properly freed, as elements are left in the internal list. This ends up causing double frees. This fixes more than one use of the fbchats command segfaulting.
* facebook: wait for the user added event after invitingjgeboski2015-09-13-1/+0
| | | | | | | Currently, as soon as a user is invited to a group chat, they are added to the group chat. In order to ensure the user is actually added, the plugin should wait for an already handled group chat event for the user being added.
* facebook: implemented group chat KICKingjgeboski2015-09-13-0/+16
|
* Change the default values of mark_read and show_unread to falsedequis2015-09-11-2/+2
|
* facebook: initialize the GLib type systemjgeboski2015-08-28-0/+4
|
* facebook-api: fixed deleted XMAs being fataljgeboski2015-08-26-3/+9
|
* facebook-api: fixed the contact query not fetching non-usersjgeboski2015-08-25-99/+63
|
* Implemented group chat topic change eventsjgeboski2015-08-25-10/+63
|
* facebook-api: fixed generic API operations always failingjgeboski2015-08-25-1/+5
|
* facebook-api: removed weird usage of g_slist_copy_deep()jgeboski2015-08-24-3/+8
|
* Imported changes from purple-facebookjgeboski2015-08-24-4732/+9266
|
* facebook-api: fixed JSON parse errors with messagesjgeboski2015-06-22-2/+9
| | | | | | | | It was assumed there was always a leading "NULL" byte prepended to each message. This is not the case, the NULL byte is actually a variable integer, which is the size for a Thrift string. In order to navigate directly the JSON data, just read the data as a thrift string in order to obtain the offset of the JSON data.
* facebook-thrift: fixed improper string sizesjgeboski2015-06-22-4/+15
| | | | | The thrift string functions were not correctly adjusting for compact and non-compact strings, it was just assumed as one or the other.
* Reset stoken when getting ERROR_QUEUE_NOT_FOUND, to create a new onedequis2015-04-03-1/+12
| | | | | | Simpler and more verbose version of my other patch which silently created a new queue - this will show up as a reconnection and should make it obvious if an infinite loop happens. jgeboski's idea, not mine.
* facebook-json: On parse error, show an escaped fragment of the inputdequis2015-03-15-1/+10
| | | | | Just for debugging purposes with users who don't run this with debug enabled.
* fb_api_cb_mqtt_publish: Show topic as part of the debug messagedequis2015-03-11-1/+1
|
* fb_mqtt_cb_read: change read size to be remz, hopefully fixing timeoutsdequis2015-03-11-1/+1
| | | | | | | | | | | | | | | | | | | | It was mqtt->rbuf->len previously, the length of the bytearray, which doesn't make a lot of sense - it resulted in reading 2, 4, 8, 16, 32 bytes and when it reached a high enough number, ssl_read would either: 1. Stop because the socket buffer got empty (the main reason it kinda worked most of the time), or 2. Continue reading into the next packet And continuing to read means not just a desync but also that remz - rize (remaining bytes - read bytes) is negative, or more precisely, a huge number, since remz is unsigned. So it gets stuck reading ~2**64 bytes into that buffer, thinking it's a neverending packet, and that means not getting pongs. So it timeouts. The fix is trivial - just make it read exactly the amount of bytes it needs to read (remz), never more than that.
* Updated copyright dates for 2015jgeboski2015-03-05-15/+15
|
* facebook-json: add fb_json_str_escape() to properly escape messagesdequis2015-03-01-1/+40
| | | | | | | | Fixes issues such as losing messages that include a quote character. Only escapes the minimum needed to work - control characters, backslashes and quotes. UTF-8 chars are still valid json, so they are sent as-is.
* facebook: default to chat_type of room for persistencejgeboski2015-01-31-4/+21
| | | | | | | | | | | As of now, group chat channels do not persist after they are left. This is due in part to the channel not being of chat_type room. Furthermore, the account and room identifiers are not set on the channel. This issue becomes apparent when the plugin disconnects from the remote services for whatever reason, and the channel is not setup again. This issue was introduced in 06956d1.
* Migrated from OPT to BEE_USER flagsjgeboski2015-01-30-1/+1
| | | | | The compatibility flags of BEE_USER provided by OPT flags should not be used as they are deprecated.
* Revert "Implemented message sending queue"jgeboski2015-01-30-45/+1
| | | | | | | | This reverts 68c46dd. While the sending queue attempted to ensure each message was sent in order, it also lead to a significant delay in the sending of messages. This is due in part to Facebook taking upwards of a minute or more to reply to a message being sent. Moreover, the queue is not really needed unless messages are being spammed.