Send every message with a unique nonce saving and saving it in a
hashtable making sure we don't echo back our own messages.
Commit is based on a patch contributed by Trecourt Nicolas, thank you!
Fixes: #182
Discord sends message times which are useful in case of pinned/backlog messages, relay those to bitlbee so that it can timestamp messages like this.
Fixes: #152
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.
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
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)
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
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.
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.
Replace newlines with a space instead of just removing it, since most of the
text pasted doesn't have trailing spaces and it looks weird after removing
newlines.
Some of the nicks have casing that is a pain to type without
tabcompletion(can happen when user is offline), this commits adds a
"mention_ignorecase" option that can be enabled to ignore case when looking for
mentions.
Instead of relying on bitlbee to do this bitlbee-discord will now canonize (or
try to) nicknames itself. This fixes outgoing mentions for nicknames with
spaces.
Previously I just assumed that the path in gateway url will always be "/" and
that it will always use secure connection. Latest discord changes proved me
wrong. Properly parsing the url now.
This commit adds automatic conversion of outgoing messages from irc-style
highlighting (e.g. "nick:") to discord's "<@id>" format. New "mention_suffix"
option is added.
Outgoing mentions currently won't work with names containing spaces.
Fixes: issue #9.
Do not traverse the lists by hand, use get_*_by_id functions from discord-util.
This adds get_user_by_id and changes get_channel_by_id to traverse all servers
in case no server is specified.
Get info and keep it in server_info channel list about voice channels. This
might later be used to somehow (imcb_log or nick changes) indicate buddies
being in voice channels (specific or in general).