Skip to content

Commit

Permalink
Pass 'reason' values around in imcb_chat_remove_buddy/chat_remove_user
Browse files Browse the repository at this point in the history
  • Loading branch information
dequis committed Aug 8, 2015
1 parent 4850065 commit 6b56512
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions irc_im.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ static gboolean bee_irc_chat_add_user(bee_t *bee, struct groupchat *c, bee_user_
return TRUE;
}

static gboolean bee_irc_chat_remove_user(bee_t *bee, struct groupchat *c, bee_user_t *bu)
static gboolean bee_irc_chat_remove_user(bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *reason)
{
irc_t *irc = bee->ui_data;
irc_channel_t *ic = c->ui_data;
Expand All @@ -665,7 +665,7 @@ static gboolean bee_irc_chat_remove_user(bee_t *bee, struct groupchat *c, bee_us
/* TODO: Possible bug here: If a module removes $user here instead of just
using imcb_chat_free() and the channel was IRC_CHANNEL_TEMP, we get into
a broken state around here. */
irc_channel_del_user(ic, bu == bee->user ? irc->user : bu->ui_data, IRC_CDU_PART, NULL);
irc_channel_del_user(ic, bu == bee->user ? irc->user : bu->ui_data, IRC_CDU_PART, reason);

return TRUE;
}
Expand Down
2 changes: 1 addition & 1 deletion protocols/bee.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ typedef struct bee_ui_funcs {
gboolean (*chat_log)(bee_t *bee, struct groupchat *c, const char *text);
gboolean (*chat_msg)(bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, time_t sent_at);
gboolean (*chat_add_user)(bee_t *bee, struct groupchat *c, bee_user_t *bu);
gboolean (*chat_remove_user)(bee_t *bee, struct groupchat *c, bee_user_t *bu);
gboolean (*chat_remove_user)(bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *reason);
gboolean (*chat_topic)(bee_t *bee, struct groupchat *c, const char *new_topic, bee_user_t *bu);
gboolean (*chat_name_hint)(bee_t *bee, struct groupchat *c, const char *name);
gboolean (*chat_invite)(bee_t *bee, bee_user_t *bu, const char *name, const char *msg);
Expand Down
2 changes: 1 addition & 1 deletion protocols/bee_chat.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void imcb_chat_remove_buddy(struct groupchat *c, const char *handle, const char
}

if (bee->ui->chat_remove_user && bu) {
bee->ui->chat_remove_user(bee, c, bu);
bee->ui->chat_remove_user(bee, c, bu, reason);
}
}

Expand Down

0 comments on commit 6b56512

Please sign in to comment.