mirror of
https://github.com/profanity-im/profanity.git
synced 2024-08-18 19:04:14 -04:00
Use handle in chat windows if available
This commit is contained in:
parent
e1c9cbc955
commit
0a3aaf5a36
@ -292,8 +292,17 @@ ui_incoming_msg(const char * const from, const char * const message,
|
|||||||
display_from = get_nick_from_full_jid(from);
|
display_from = get_nick_from_full_jid(from);
|
||||||
} else {
|
} else {
|
||||||
win_type = WIN_CHAT;
|
win_type = WIN_CHAT;
|
||||||
|
PContact contact = roster_get_contact(from);
|
||||||
|
if (contact != NULL) {
|
||||||
|
if (p_contact_name(contact) != NULL) {
|
||||||
|
display_from = strdup(p_contact_name(contact));
|
||||||
|
} else {
|
||||||
display_from = strdup(from);
|
display_from = strdup(from);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
display_from = strdup(from);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int win_index = _find_prof_win_index(from);
|
int win_index = _find_prof_win_index(from);
|
||||||
if (win_index == NUM_WINS) {
|
if (win_index == NUM_WINS) {
|
||||||
@ -317,12 +326,12 @@ ui_incoming_msg(const char * const from, const char * const message,
|
|||||||
|
|
||||||
if (strncmp(message, "/me ", 4) == 0) {
|
if (strncmp(message, "/me ", 4) == 0) {
|
||||||
wattron(console->win, COLOUR_THEM);
|
wattron(console->win, COLOUR_THEM);
|
||||||
wprintw(console->win, "*%s ", from);
|
wprintw(console->win, "*%s ", display_from);
|
||||||
wprintw(console->win, "%s", message + 4);
|
wprintw(console->win, "%s", message + 4);
|
||||||
wprintw(console->win, "\n");
|
wprintw(console->win, "\n");
|
||||||
wattroff(console->win, COLOUR_THEM);
|
wattroff(console->win, COLOUR_THEM);
|
||||||
} else {
|
} else {
|
||||||
_win_show_user(console->win, from, 1);
|
_win_show_user(console->win, display_from, 1);
|
||||||
_win_show_message(console->win, message);
|
_win_show_message(console->win, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,7 +423,7 @@ ui_incoming_msg(const char * const from, const char * const message,
|
|||||||
if (prefs_get_boolean(PREF_NOTIFY_MESSAGE))
|
if (prefs_get_boolean(PREF_NOTIFY_MESSAGE))
|
||||||
notify_message(display_from);
|
notify_message(display_from);
|
||||||
|
|
||||||
g_free(display_from);
|
FREE_SET_NULL(display_from);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user