summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/server.js b/server.js
index 132c1cd..3dc7e52 100644
--- a/server.js
+++ b/server.js
@@ -1466,6 +1466,15 @@ function annotate_game_info(game, user_id, unread) {
game.result = `<a href="/user/${p.name}">${p.name}</a> (${game.result})`
}
+ if (game.result && game.result.includes(",")) {
+ game.result = game.result.split(", ").map(role => {
+ for (let p of game.players)
+ if (p.role === role)
+ return `<a href="/user/${p.name}">${p.name}</a>`
+ return role
+ }).join(", ")
+ }
+
if (game.status === STATUS_OPEN && game.is_ready && game.owner_id === user_id)
game.your_turn = true