Commit Graph

275 Commits

Author SHA1 Message Date
Artem Savkov 5a92f69aef
Merge pull request #144 from jwheare/animoji
Handle animated emoji
2018-03-30 14:10:02 +02:00
James Wheare f29bd80c20 Handle animated emoji 2018-03-30 10:41:53 +01:00
Artem Savkov caa739f6bf
Merge pull request #142 from ddasilva/ddasilva/docker
Tweak contrib/docker; fix permissions, enhance readme, change to ForkDaemon
2018-03-11 20:54:38 +01:00
Daniel da Silva 2a6009a5ed Tweak contrib/docker; change to ForkDaemon for one process per user (increased security), fix permissions and add copy/paste run command to readme. 2018-03-11 19:13:46 +00:00
Artem Savkov cbba1b1cf9 Add a dockerfile
Add a dockerfile for bitlbee + bitlbee-discord contributed by
Daniel da Silva <mail@danieldasilva.org>
2018-03-11 09:12:44 +01:00
Artem Savkov 7375256275 Adjust hertbeat ack timeout
Discord's docs specify that heartbeat ack should be received between
heartbeats, so adjust this to just under keepalive_interval.
I don't expect it to trigger often (or at all). Based on what I saw so
far we are much more likely to get some sort of websocket error before
this triggers.
2018-02-23 09:21:15 +01:00
Artem Savkov 89c70d362a Switch most of ws errors to soft-reconnect
In WS_READY state (after we got server info) it should be safe to do a
soft-reconnect on any of the websocket errors instead of full relogin.
This should improve relogin situation quite a bit since these are
causing the most reconnections.
2018-02-23 09:14:54 +01:00
Artem Savkov 2d9f509258 Make json-parse errors distinguishable
Same as ws-readdata errors, these used to return the same message, add
function name to the message to make it clear where we failed.
2018-02-23 09:02:35 +01:00
Artem Savkov 94690213d7 Rename soft-reconnect function
Rename discord_reconnect to discord_soft_reconnect to reflect it's
nature.
2018-02-23 08:51:23 +01:00
Artem Savkov 4a5cd6dad3 Make ws-read errors distinguishable
All of the possible websocket read errors previosly just resulted in a
"Failed to read data" error making it imposible to determine which part
failed. Rephrased those errors.
2018-02-23 08:45:33 +01:00
Artem Savkov 6a251d1e1c Soft reconnect on heartbeat timeout
Reconnect with resume if heartbeat ack is not received for 7 seconds.
2018-02-14 22:00:56 +01:00
Artem Savkov 5fe08f6cd6 Resume support
Add support for resuming connection after reconnect without doing full
reconnect that entitles a lot of heavy-lifting.
2018-02-14 21:10:24 +01:00
Artem Savkov 063c8bb68a Keep track of session_id
Session_id is used to resume connection, write it down on connect.
2018-02-13 22:24:34 +01:00
Artem Savkov 0a84f9dd6b
Merge pull request #135 from eclipseo/remove_obsolete_m4s_macro
Remove obsolete m4s macro from configure
2018-02-06 21:11:32 +01:00
Robert-André Mauchin efed4fce94 Remove obsolete m4s macro from configure 2018-02-06 20:54:27 +01:00
Artem Savkov 18a80a234f Fix time_t printf format warning.
time_t as a type differs on different systems, so we can't use %tu
without casting. Cast it to llu so that it always fits.

Fixes: #133
2018-02-02 18:08:09 +01:00
Artem Savkov 92d0fc47cb Make new options OFFLINE_ONLY
Make auto_join and auto_join_exclude OFFLINE_ONLY as they only have
effect on connect.
2018-01-27 18:09:33 +01:00
Artem Savkov 43b75dba78
Merge pull request #129 from mickael9/autojoin
Add channel autojoining (off by default)
2018-01-27 18:04:26 +01:00
Mickaël Thomas f7b4f07c07 Readability Counts. 2018-01-27 11:37:34 +01:00
Mickaël Thomas 562138097f Update help 2018-01-27 11:26:44 +01:00
Mickaël Thomas c0851d68a0 Add channel autojoining (off by default)
Fixes #74
2018-01-26 19:57:49 +01:00
Artem Savkov 549b05a6c3 Cleaner stdout
Change leftover g_prints to either imcb_* or discord_debug calls.
2018-01-07 09:44:03 +01:00
Artem Savkov 3e435b0c6b Bump version to 0.4.1
To commemorate the end of missed private messages epoch.
2018-01-06 22:26:56 +01:00
Artem Savkov 64c179b9bb Private messages matter
Getting backlog of private messages is actually desired by many users.
Now you can find out that people tried to message you for months.
2018-01-06 22:23:45 +01:00
Artem Savkov 39a4fc6010
Merge pull request #123 from Alcaro/master
Fix use-after-free on OPCODE_RECONNECT/INVALID_SESSION
2018-01-01 16:06:51 +01:00
Alcaro 4c1a77d048 Switch to return value 2018-01-01 15:15:13 +01:00
Alcaro c15b946bda Fix use-after-free on OPCODE_RECONNECT/INVALID_SESSION 2017-12-30 23:41:41 +01:00
Artem Savkov 6a03db169a Don't send acks on old messages
Sending acks for old messages (e.g. out of sync pins) screws up
discord's "last_read", so on next login you are getting backlog spammed.
Try to fix this by not sending acks for messages that are older than
our own last_read.
2017-12-27 17:25:56 +01:00
Artem Savkov 24601035a1 Handle rate limiting
If the client sends http requests too fast discord will start
rate-limiting those asking to retry after some time. Do that instead of
failing the request.
2017-12-27 17:13:53 +01:00
Artem Savkov fbba140ac4 Add a function to send raw http requests
Add a function that takes a char* http request as and argument, does
the request and places it into the queue. Make all of the functions that
used to call http_dorequest() directly use this instead.
2017-12-27 13:47:08 +01:00
Artem Savkov dcbee31618
Merge pull request #121 from Alcaro/master
Update away status handler
2017-12-22 10:26:13 +01:00
Alcaro 4b1d4ea114 Update away handlers 2017-12-21 14:44:21 +01:00
Artem Savkov 953c12acef Bump plugin version
Switch to plugin version in configure.ac and bump it to 0.4.0
2017-12-09 17:42:46 +01:00
Artem Savkov 0e04b56f23
Merge pull request #116 from arcnmx/group-dm
Group DMs
2017-12-09 17:39:31 +01:00
Artem Savkov da7ac86f9c
Merge pull request #115 from arcnmx/heartbeat
Heartbeat and reconnect opcodes
2017-11-28 08:09:00 +01:00
arcnmx a11c4f4110 Group DMs don't really have topics 2017-11-27 15:18:51 -05:00
arcnmx 0a2219acfa Group DMs (fixes #54) 2017-11-27 13:30:21 -05:00
arcnmx 4f7f17d90a Indenting fix 2017-11-27 12:45:16 -05:00
arcnmx ac2900dc90 imcb_log on reconnect opcode 2017-11-26 12:21:05 -05:00
arcnmx 716b0065ac respond to heartbeats and obey reconnect requests 2017-11-25 23:08:22 -05:00
arcnmx b555a1bc09 Unhandled event names 2017-11-25 23:08:22 -05:00
Artem Savkov f11eaae113
Merge pull request #113 from arcnmx/unhandled-events
Additional unhandled events
2017-11-15 09:07:31 +02:00
arcnmx 4b540449e5 additional unhandled events 2017-11-14 14:31:32 -05:00
Artem Savkov 18bcf335af Fix lastmsg/lastread logic
Streamline this a bit making variables do what their names imply.

Fixes: #108
2017-10-04 19:59:29 +02:00
Artem Savkov 4f1671c93f Merge pull request #106 from jwheare/custom-emoji
Convert custom emoji to the code and URL
2017-09-27 14:46:02 +02:00
James Wheare e2f8345eab Convert custom emoji to the code and URL 2017-09-27 13:15:50 +01:00
dx fdc2c83ca3 Friendship mode
Add friendship_mode option that would only show friends in the control channel while still showing non-friends in discord channels.

Fixes: #89
2017-09-24 19:44:20 +02:00
Artem Savkov 8f39093181 Merge pull request #104 from mickael9/no-servers
Fix login failure when no servers exist

Fixes: #66
2017-09-24 00:04:06 +02:00
Mickaël Thomas 6f210dab0a Read all available data from the SSL buffer (#105)
We could end up in a situation where websocket messages would stay stuck
in the SSL buffer because we only read one at a time although the SSL
buffer can hold more.
2017-09-23 23:59:52 +02:00
Artem Savkov 407a73e321 login message: wrong password
Show proper login failure reason for 'wrong password' case.
2017-09-23 15:03:30 +02:00