Show message in private windows when user offline

This commit is contained in:
James Booth
2016-02-02 21:52:13 +00:00
parent f0837abf0a
commit 150015fa3d
7 changed files with 60 additions and 4 deletions

View File

@@ -111,6 +111,36 @@ privwin_outgoing_msg(ProfPrivateWin *privwin, const char *const message)
win_print((ProfWin*)privwin, '-', 0, NULL, 0, THEME_TEXT_ME, "me", message);
}
void
privwin_message_occupant_offline(ProfPrivateWin *privwin)
{
assert(privwin != NULL);
win_print((ProfWin*)privwin, '-', 0, NULL, 0, THEME_ERROR, NULL, "Unable to send message, occupant no longer present in room.");
}
void
privwin_occupant_offline(ProfPrivateWin *privwin)
{
assert(privwin != NULL);
privwin->occupant_offline = TRUE;
Jid *jidp = jid_create(privwin->fulljid);
win_vprint((ProfWin*)privwin, '-', 0, NULL, 0, THEME_OFFLINE, NULL, "-- %s has left the room.", jidp->resourcepart);
jid_destroy(jidp);
}
void
privwin_occupant_online(ProfPrivateWin *privwin)
{
assert(privwin != NULL);
privwin->occupant_offline = FALSE;
Jid *jidp = jid_create(privwin->fulljid);
win_vprint((ProfWin*)privwin, '-', 0, NULL, 0, THEME_ONLINE, NULL, "-- %s has joined the room.", jidp->resourcepart);
jid_destroy(jidp);
}
char*
privwin_get_string(ProfPrivateWin *privwin)
{