remove hacky autojoin option

v1
Tony Olagbaiye 3 years ago
parent 0048ffde4c
commit dc00c41b4f
No known key found for this signature in database
GPG Key ID: 9E2FF3BDEBDFC910

@ -31,7 +31,6 @@ char *account_options[ACCOUNT_NUM_OPTIONS][2] =
{ "autoconnect", "" }, { "autoconnect", "" },
{ "resource", "" }, { "resource", "" },
{ "status", "probably about to segfault" }, { "status", "probably about to segfault" },
{ "autojoin", "" },
}; };
struct t_account *account__search(const char *name) struct t_account *account__search(const char *name)

@ -17,7 +17,6 @@ enum t_account_option
ACCOUNT_OPTION_AUTOCONNECT, ACCOUNT_OPTION_AUTOCONNECT,
ACCOUNT_OPTION_RESOURCE, ACCOUNT_OPTION_RESOURCE,
ACCOUNT_OPTION_STATUS, ACCOUNT_OPTION_STATUS,
ACCOUNT_OPTION_AUTOJOIN,
ACCOUNT_NUM_OPTIONS, ACCOUNT_NUM_OPTIONS,
}; };
@ -55,8 +54,6 @@ enum t_account_option
weechat_config_string(account->options[ACCOUNT_OPTION_RESOURCE]) weechat_config_string(account->options[ACCOUNT_OPTION_RESOURCE])
#define account_status(account) \ #define account_status(account) \
weechat_config_string(account->options[ACCOUNT_OPTION_STATUS]) weechat_config_string(account->options[ACCOUNT_OPTION_STATUS])
#define account_autojoin(account) \
weechat_config_string(account->options[ACCOUNT_OPTION_AUTOJOIN])
struct t_device struct t_device
{ {

@ -613,15 +613,17 @@ struct t_channel_member *channel__add_member(struct t_account *account,
char *jid_resource = xmpp_jid_resource(account->context, user->id); char *jid_resource = xmpp_jid_resource(account->context, user->id);
if (weechat_strcasecmp(jid_bare, channel->id) == 0 if (weechat_strcasecmp(jid_bare, channel->id) == 0
&& channel->type == CHANNEL_TYPE_MUC) && channel->type == CHANNEL_TYPE_MUC)
weechat_printf_date_tags(channel->buffer, 0, "xmpp_presence,enter,log4", "%s%s entered", weechat_printf_date_tags(channel->buffer, 0, "xmpp_presence,enter,log4", "%s%s entered %s",
weechat_prefix("join"), weechat_prefix("join"),
user__as_prefix_raw(account, jid_resource)); user__as_prefix_raw(account, jid_resource),
channel->id);
else else
weechat_printf_date_tags(channel->buffer, 0, "xmpp_presence,enter,log4", "%s%s (%s) entered", weechat_printf_date_tags(channel->buffer, 0, "xmpp_presence,enter,log4", "%s%s (%s) entered %s",
weechat_prefix("join"), weechat_prefix("join"),
xmpp_jid_bare(account->context, user->id), xmpp_jid_bare(account->context, user->id),
user__as_prefix_raw(account, user__as_prefix_raw(account,
xmpp_jid_resource(account->context, user->id))); xmpp_jid_resource(account->context, user->id)),
channel->id);
return member; return member;
} }
@ -703,14 +705,16 @@ struct t_channel_member *channel__remove_member(struct t_account *account,
char *jid_resource = xmpp_jid_resource(account->context, user->id); char *jid_resource = xmpp_jid_resource(account->context, user->id);
if (weechat_strcasecmp(jid_bare, channel->id) == 0 if (weechat_strcasecmp(jid_bare, channel->id) == 0
&& channel->type == CHANNEL_TYPE_MUC) && channel->type == CHANNEL_TYPE_MUC)
weechat_printf_date_tags(channel->buffer, 0, "xmpp_presence,leave,log4", "%s%s left", weechat_printf_date_tags(channel->buffer, 0, "xmpp_presence,leave,log4", "%s%s left %s",
weechat_prefix("quit"), weechat_prefix("quit"),
jid_resource); jid_resource,
channel->id);
else else
weechat_printf_date_tags(channel->buffer, 0, "xmpp_presence,leave,log4", "%s%s (%s) left", weechat_printf_date_tags(channel->buffer, 0, "xmpp_presence,leave,log4", "%s%s (%s) left %s",
weechat_prefix("quit"), weechat_prefix("quit"),
xmpp_jid_bare(account->context, user->id), xmpp_jid_bare(account->context, user->id),
xmpp_jid_resource(account->context, user->id)); xmpp_jid_resource(account->context, user->id),
channel->id);
return member; return member;
} }
@ -749,7 +753,7 @@ void channel__send_message(struct t_account *account, struct t_channel *channel,
xmpp_send(account->connection, message); xmpp_send(account->connection, message);
xmpp_stanza_release(message); xmpp_stanza_release(message);
if (channel->type != CHANNEL_TYPE_MUC) if (channel->type != CHANNEL_TYPE_MUC)
weechat_printf(channel->buffer, "%s%s", weechat_printf(channel->buffer, "%s\t%s",
user__as_prefix_raw(account, account_jid(account)), user__as_prefix_raw(account, account_jid(account)),
body); body);
} }

@ -186,22 +186,6 @@ config__account_new_option (struct t_config_file *config_file,
callback_change_data, callback_change_data,
NULL, NULL, NULL); NULL, NULL, NULL);
break; break;
case ACCOUNT_OPTION_AUTOJOIN:
new_option = weechat_config_new_option (
config_file, section,
option_name, "string",
N_("XMPP MUC Autojoins"),
NULL, 0, 0,
default_value, value,
null_value_allowed,
callback_check_value,
callback_check_value_pointer,
callback_check_value_data,
callback_change,
callback_change_pointer,
callback_change_data,
NULL, NULL, NULL);
break;
case ACCOUNT_NUM_OPTIONS: case ACCOUNT_NUM_OPTIONS:
break; break;
} }

Loading…
Cancel
Save