Skip to content

Commit

Permalink
Add disable_acks per-account option.
Browse files Browse the repository at this point in the history
Add an option that will allow users to disable message acks, might be useful
when using bitlbee as a backup solution.
  • Loading branch information
sm00th committed Jan 1, 2016
1 parent 1bca664 commit 303c777
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ This section describes options available throug "account set" bitlbee command
Maximum number of backlog messages per channel to fetch on connection.
Unlike twitter implementation in bitlbee this won't dump seen messages.

- disable_acks (type: boolean; default: no)
By default bitlbee-discord will send an "ack" for every message received,
thus marking everything as "read" on mobile/webapp. Setting this to true
will disable all acks from bitlbee-discord.

Bugs
----
Plugin is in early development stages, so there should be plenty, please report
Expand Down
4 changes: 4 additions & 0 deletions src/discord-http.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ void discord_http_send_msg(struct im_connection *ic, const char *id,
void discord_http_send_ack(struct im_connection *ic, const char *channel_id,
const char *message_id)
{
if (set_getbool(&ic->acc->set, "disable_acks") == TRUE) {
return;
}

discord_data *dd = ic->proto_data;
GString *request = g_string_new("");

Expand Down
1 change: 1 addition & 0 deletions src/discord.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ static void discord_init(account_t *acc)
s->flags |= ACC_SET_OFFLINE_ONLY;

s = set_add(&acc->set, "voice_status_notify", "off", set_eval_bool, acc);
s = set_add(&acc->set, "disable_acks", "off", set_eval_bool, acc);
s = set_add(&acc->set, "edit_prefix", "EDIT: ", NULL, acc);
s = set_add(&acc->set, "urlinfo_handle", "urlinfo", NULL, acc);

Expand Down

0 comments on commit 303c777

Please sign in to comment.