Various works in progress.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3376 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2017-01-11 02:14:22 +00:00
parent 15f3a3351e
commit 63361ec1f8
3 changed files with 29 additions and 14 deletions

View File

@ -219,8 +219,8 @@ function updateWindows() {
for (let j in conversations) {
terminal.print({
command: "/command " + JSON.stringify({action: "window", account: account.id, conversation: j}),
value: j ? j : "<service>",
style: (conversations[j] == gCurrentConversation ? "font-weight: bold; " : "") + "color: white",
value: (j ? j : "<service>") + (conversations[j].unread ? " (" + conversations[j].unread + ")" : ""),
style: (conversations[j] == gCurrentConversation ? "background-color: white; color: black" : ""),
});
}
}
@ -252,15 +252,16 @@ function updateConversation() {
terminal.clear();
printToConversation(gCurrentConversation, ["[", gCurrentConversation.name, "]"]);
if (history) {
let previous = Promise.resolve();
for (let message of history) {
previous = previous.then(x => printToConversation(gCurrentConversation, message));
printToConversation(gCurrentConversation, message);
}
}
updateUsers();
} finally {
terminal.uncork();
}
gCurrentConversation.unread = 0;
updateWindows();
}).catch(function(error) {
terminal.print(error);
});
@ -313,6 +314,7 @@ function getConversation(session, conversationName) {
return session.sendMessage(key, message);
},
participants: [],
unread: 0,
};
updateWindows();
}
@ -342,6 +344,9 @@ function printToConversation(conversation, message, notify) {
} else {
terminal.print(message);
}
} else {
conversation.unread++;
updateWindows();
}
if (notify && !gFocus) {
gUnread++;