mirror of
https://github.com/hexchat/hexchat.git
synced 2024-11-06 11:12:34 +01:00
Fix broken logic in mg_word_clicked(). fixes #522
This commit is contained in:
parent
f0d0f90e13
commit
a5eb7784c6
@ -2236,26 +2236,29 @@ mg_word_clicked (GtkWidget *xtext, char *word, GdkEventButton *even)
|
|||||||
int word_type, start, end;
|
int word_type, start, end;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
|
if (word)
|
||||||
|
{
|
||||||
|
word_type = mg_word_check (xtext, word);
|
||||||
|
url_last (&start, &end);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (even->button == 1) /* left button */
|
||||||
|
{
|
||||||
if (word == NULL)
|
if (word == NULL)
|
||||||
{
|
{
|
||||||
if (even->button == 1) /* left button */
|
|
||||||
mg_focus (sess);
|
mg_focus (sess);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
word_type = mg_word_check (xtext, word);
|
if ((even->state & 13) == prefs.hex_gui_url_mod)
|
||||||
url_last (&start, &end);
|
|
||||||
|
|
||||||
if (even->button == 1 && (even->state & 13) == prefs.hex_gui_url_mod)
|
|
||||||
{
|
{
|
||||||
switch (word_type)
|
switch (word_type)
|
||||||
{
|
{
|
||||||
case WORD_URL:
|
case WORD_URL:
|
||||||
case WORD_HOST:
|
case WORD_HOST:
|
||||||
word[end] = 0;
|
|
||||||
word += start;
|
|
||||||
fe_open_url (word);
|
fe_open_url (word);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2267,6 +2270,8 @@ mg_word_clicked (GtkWidget *xtext, char *word, GdkEventButton *even)
|
|||||||
userlist_select (sess, word);
|
userlist_select (sess, word);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (word == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
switch (word_type)
|
switch (word_type)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user