Messages sent from another discord client will now appear as if you sent
them from Bitlbee.
See https://wiki.bitlbee.org/SelfMessages for more information about
this feature.
Fixes: #7
As discord_data.seq is a guint64, use G_GUINT64_FORMAT instead of
PRIu64. This fixes "warning: format specifies type 'unsigned long
long' but the argument has type 'guint64'".
Sometimes on disconnect there might be leftover io event source. Clean
it up properly on logout to avoid any possible 'use-after-free' errors.
Fixes#97
This reverts commit 84315b6bfc.
Turns out it wasn't harmless, and it breaks mac OS. Instead of adding
platform checks here, this flag is now included in the cygwin-specific
parts of the bitlbee pkg-config file, as of bitlbee commit b9c10a1a
(version string 3.5.1+20170529+develop+18-gb9c10a1a-git)
Fixes issues with invalid utf8 in servers that start their names with
unicode characters (like emoji)
Oddly enough there's no glib function for this, and bitlbee's
truncate_utf8() does the opposite of what we need to do here (truncates
by bytes instead of characters and ensures those bytes are valid utf8)
Quoting https://cygwin.com/ml/cygwin/2013-07/msg00421.html
>despite popular misconception, this flag is harmless on non-PE targets
This also depends on changes on the bitlbee side to be able to link to
bitlbee itself, see bitlbee commit 54b2a367 (version string
3.5.1+20170513+develop+16-g54b2a367-git)
This is unfortunate (given the somewhat generic header names) but that's
how it should be used to support non-system-wide installs.
With the previous include set up, building this plugin only worked when
bitlbee's headers were in /usr/include/bitlbee, because /usr/include is
in the default include path and the -I/usr/include/bitlbee is unused
(because /usr/include/bitlbee/bitlbee does not exist)
Likely related to #77
Some times instead of ussing "message" field as always discord chooses
to report errors in "email" field, which results in "null" login errors.
Fixes: #65, #72
Add an option to fetch pinned messages on channel join. As a sideeffect
we now account for lingering http requests and cancel them on logout.
This might have caused an occasional segfault when we get logged out
while some http request was still pending.
When channel is deleted we are currently freeing bci, but the pointer is
left in ic->chatlist list, which might have disastorous consequences.
Make sure we remove it.
Bitlbee doesn't expect channels with the same name, so when you have
multiple channels with the same name only one of them can be joined.
This commit sets server_prefix_len to 3 by default and keeps adding '_'s
to the channel name until we get a unique name.
Fixes: #51
Switch from --enable-debug config option to BITLBEE_DEBUG env var to be
consistent with bitlbee. This allows us to remove some of the http printouts
as bitlbee will do it itself. Also adding account username to debug
output to distinguish traffic between accs.
Before listchan merge we checked if max_backlog > 0 before fetching
backlog, unfortunately this check was lost causing discord to throw
errros at users when limit wasn't right.
Adding the check and a note about this to README.
mfa_cb and login_cb used imcb_error without formatting, that leads to
compiler warnings/errors in some cases. Now using proper formatting
which gives us a bit more verbosity as well.
Issue #67.
Previous fix for global frineds not showing up didn't really work
because we always need to tie a user to some "guild" and global users
didn't have one. Fixing it by adding a fake global "guild" with id 0 for
this.
Users from private channels no longer need to be on the same servers as
you are, so we need to add them separately. We still don't handle their
statuses, but at least you'll be able to communicate with them normally.
Fixes: #64
Bitlbee can use both glib and libevent eventloops, but
g_main_context_iteration is glib's function so in case when bitlbee uses
libevent it would create and try to iterate a completely unrelated
eventloop.
Removing this doesn't seem to break anything as it was added at the
point where there was no mechanism to track if all servers are synced.
Should fix issue #62.
Before this commit beecord would call imcb_connected() on every
GUILD_CREATE since we now assynchronously do GUILD_SYNC for each of
those. We only need to call this if current state is WS_ALMOST_READY.
Define discord opcodes in an enum so it is easier to read the sources.
Unfortunately there are more of them than it is listed here or in the
documentation, but at this point I can't tell what those do.
Change things around to work with poorly documented v6 api that is sure
to bring breathtaking debugging sessions with it.
Basic functionality seems to all be there, but some things might be
broken still.
Apparently discord changed the way they advertise heartbeat interval and
the value used in hearbeat pings client supposed to send. This seems to
fix the disconnect issue, although more testing is needed and further
changes might be needed.
Issue: #57
Change things around to work with poorly documented v6 api that is sure
to bring breathtaking debugging sessions with it.
Basic functionality seems to all be there, but some things might be
broken still.
Apparently discord changed the way they advertise heartbeat interval and
the value used in hearbeat pings client supposed to send. This seems to
fix the disconnect issue, although more testing is needed and further
changes might be needed.
Issue: #57
Before this commit bitlbee-discord would ack all incoming messages
regardless of whether they were actually sent to bitlbee for user to
see.
It will now check whether the message was actually posted to bitlbee
before acking it.
Fixes issue #52.