Load roster before sending presence
This commit is contained in:
@@ -427,8 +427,8 @@ win_show_outgoing_msg(const char * const from, const char * const to,
|
||||
}
|
||||
|
||||
if (contact != NULL) {
|
||||
if (strcmp(p_contact_show(contact), "offline") == 0) {
|
||||
const char const *show = p_contact_show(contact);
|
||||
if (strcmp(p_contact_presence(contact), "offline") == 0) {
|
||||
const char const *show = p_contact_presence(contact);
|
||||
const char const *status = p_contact_status(contact);
|
||||
_show_status_string(win, to, show, status, "--", "offline");
|
||||
}
|
||||
@@ -703,41 +703,41 @@ cons_show_contacts(GSList *list)
|
||||
|
||||
while(curr) {
|
||||
PContact contact = curr->data;
|
||||
const char *show = p_contact_show(contact);
|
||||
const char *presence = p_contact_presence(contact);
|
||||
|
||||
_win_show_time(_cons_win);
|
||||
|
||||
if (strcmp(show, "online") == 0) {
|
||||
if (strcmp(presence, "online") == 0) {
|
||||
wattron(_cons_win, COLOUR_ONLINE);
|
||||
} else if (strcmp(show, "away") == 0) {
|
||||
} else if (strcmp(presence, "away") == 0) {
|
||||
wattron(_cons_win, COLOUR_AWAY);
|
||||
} else if (strcmp(show, "chat") == 0) {
|
||||
} else if (strcmp(presence, "chat") == 0) {
|
||||
wattron(_cons_win, COLOUR_CHAT);
|
||||
} else if (strcmp(show, "dnd") == 0) {
|
||||
} else if (strcmp(presence, "dnd") == 0) {
|
||||
wattron(_cons_win, COLOUR_DND);
|
||||
} else if (strcmp(show, "xa") == 0) {
|
||||
} else if (strcmp(presence, "xa") == 0) {
|
||||
wattron(_cons_win, COLOUR_XA);
|
||||
} else {
|
||||
wattron(_cons_win, COLOUR_OFFLINE);
|
||||
}
|
||||
|
||||
wprintw(_cons_win, "%s", p_contact_name(contact));
|
||||
wprintw(_cons_win, " is %s", show);
|
||||
wprintw(_cons_win, "%s", p_contact_jid(contact));
|
||||
wprintw(_cons_win, " is %s", presence);
|
||||
|
||||
if (p_contact_status(contact))
|
||||
wprintw(_cons_win, ", \"%s\"", p_contact_status(contact));
|
||||
|
||||
wprintw(_cons_win, "\n");
|
||||
|
||||
if (strcmp(show, "online") == 0) {
|
||||
if (strcmp(presence, "online") == 0) {
|
||||
wattroff(_cons_win, COLOUR_ONLINE);
|
||||
} else if (strcmp(show, "away") == 0) {
|
||||
} else if (strcmp(presence, "away") == 0) {
|
||||
wattroff(_cons_win, COLOUR_AWAY);
|
||||
} else if (strcmp(show, "chat") == 0) {
|
||||
} else if (strcmp(presence, "chat") == 0) {
|
||||
wattroff(_cons_win, COLOUR_CHAT);
|
||||
} else if (strcmp(show, "dnd") == 0) {
|
||||
} else if (strcmp(presence, "dnd") == 0) {
|
||||
wattroff(_cons_win, COLOUR_DND);
|
||||
} else if (strcmp(show, "xa") == 0) {
|
||||
} else if (strcmp(presence, "xa") == 0) {
|
||||
wattroff(_cons_win, COLOUR_XA);
|
||||
} else {
|
||||
wattroff(_cons_win, COLOUR_OFFLINE);
|
||||
|
||||
Reference in New Issue
Block a user