mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
windows: print outgoing messages for all contacts
When contact list doesn't contain a contact outgoing messages aren't printed to chat window. But incoming ones is printed. The patch fixes this and make profanity show "%s is not one of your contacts." only once on creating window.
This commit is contained in:
parent
4e05e919b2
commit
8200c959f8
@ -371,10 +371,6 @@ win_show_outgoing_msg(const char * const from, const char * const to,
|
||||
{
|
||||
// if the contact is offline, show a message
|
||||
PContact contact = contact_list_get_contact(to);
|
||||
|
||||
if (contact == NULL) {
|
||||
cons_show("%s is not one of your contacts.");
|
||||
} else {
|
||||
int win_index = _find_prof_win_index(to);
|
||||
WINDOW *win = NULL;
|
||||
|
||||
@ -387,11 +383,16 @@ win_show_outgoing_msg(const char * const from, const char * const to,
|
||||
_win_show_history(win, win_index, to);
|
||||
}
|
||||
|
||||
// say whether contact is in roster only once on creating window
|
||||
if (contact == NULL) {
|
||||
cons_show("%s is not one of your contacts.");
|
||||
} else {
|
||||
if (strcmp(p_contact_show(contact), "offline") == 0) {
|
||||
const char const *show = p_contact_show(contact);
|
||||
const char const *status = p_contact_status(contact);
|
||||
_show_status_string(win, to, show, status, "--", "offline");
|
||||
}
|
||||
}
|
||||
|
||||
// use existing window
|
||||
} else {
|
||||
@ -402,7 +403,6 @@ win_show_outgoing_msg(const char * const from, const char * const to,
|
||||
_win_show_user(win, from, 0);
|
||||
_win_show_message(win, message);
|
||||
_win_switch_if_active(win_index);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user