diff options
Diffstat (limited to 'irc_channel.c')
-rw-r--r-- | irc_channel.c | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/irc_channel.c b/irc_channel.c index 097476dd..34ed54a9 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -866,39 +866,17 @@ static char *set_eval_by_account(set_t *set, char *value) struct irc_channel *ic = set->data; struct irc_control_channel *icc = ic->data; account_t *acc; - GSList *accl, *new_acc = NULL; - char **accounts, **account; - accounts = g_strsplit(value, ",", 0); - if (accounts == NULL) { - goto fail; - } - - for (account = accounts; *account; account++) { - if (!(acc = account_get(ic->irc->b, *account))) { - goto fail; - } else { - new_acc = g_slist_append(new_acc, acc); - } + if (!(acc = account_get(ic->irc->b, value))) { + return SET_INVALID; } - accl = icc->account; - g_slist_free(accl); - - icc->account = new_acc; + icc->account = acc; if ((icc->type & IRC_CC_TYPE_MASK) == IRC_CC_TYPE_ACCOUNT) { bee_irc_channel_update(ic->irc, ic, NULL); } - g_strfreev(accounts); - - return g_strdup(value); - -fail: - g_slist_free(new_acc); - g_strfreev(accounts); - - return SET_INVALID; + return g_strdup(acc->tag); } static char *set_eval_fill_by(set_t *set, char *value) @@ -1022,7 +1000,6 @@ fail: gboolean irc_channel_wants_user(irc_channel_t *ic, irc_user_t *iu) { struct irc_control_channel *icc = ic->data; - GSList *accl; gboolean ret = FALSE; if (iu->bu == NULL) { @@ -1034,13 +1011,7 @@ gboolean irc_channel_wants_user(irc_channel_t *ic, irc_user_t *iu) ret = iu->bu->group == icc->group; break; case IRC_CC_TYPE_ACCOUNT: - for (accl = icc->account; accl; accl = accl->next) { - account_t *acc = accl->data; - if (iu->bu->ic->acc == acc) { - ret = TRUE; - break; - } - } + ret = iu->bu->ic->acc == icc->account; break; case IRC_CC_TYPE_PROTOCOL: ret = iu->bu->ic->acc->prpl == icc->protocol; @@ -1068,7 +1039,6 @@ static gboolean control_channel_free(irc_channel_t *ic) set_del(&ic->set, "protocol"); set_del(&ic->set, "show_users"); - g_slist_free(icc->account); g_free(icc); ic->data = NULL; |