fishlim: Fix compare nicks using hexchat_nickcmp

This commit is contained in:
BakasuraRCE 2019-05-30 23:56:11 -05:00
parent 6471f950e1
commit c2632e67b7

View File

@ -55,6 +55,13 @@ static hexchat_plugin *ph;
static GHashTable *pending_exchanges;
/**
* Compare two nicks using the current plugin
*/
int irc_nick_cmp(const char *a, const char *b) {
return hexchat_nickcmp (ph, a, b);
}
/**
* Returns the path to the key store file.
*/
@ -90,7 +97,7 @@ static hexchat_context *find_context_on_network (const char *name) {
int chan_id = hexchat_list_int(ph, channels, "id");
const char *chan_name = hexchat_list_str(ph, channels, "channel");
if (chan_id == id && chan_name && hexchat_nickcmp (ph, chan_name, name) == 0) {
if (chan_id == id && chan_name && irc_nick_cmp (chan_name, name) == 0) {
ret = (hexchat_context*)hexchat_list_str(ph, channels, "context");
break;
}
@ -119,7 +126,7 @@ char *get_my_own_prefix(void) {
list = hexchat_list_get (ph, "users");
if (list) {
while (hexchat_list_next(ph, list)) {
if (strcmp(own_nick, hexchat_list_str(ph, list, "nick")) == 0)
if (irc_nick_cmp(own_nick, hexchat_list_str(ph, list, "nick")) == 0)
result = g_strdup(hexchat_list_str(ph, list, "prefix"));
}
hexchat_list_free(ph, list);
@ -128,10 +135,6 @@ char *get_my_own_prefix(void) {
return result;
}
int irc_nick_cmp(const char *a, const char *b) {
return hexchat_nickcmp (ph, a, b);
}
/*static int handle_debug(char *word[], char *word_eol[], void *userdata) {
hexchat_printf(ph, "debug incoming: ");
for (size_t i = 1; word[i] != NULL && word[i][0] != '\0'; i++) {