We should implement a more complete messaging system to allow empires to talk with each other. This article describes the design:

UX

  • We add a modal window, called the Message Window, that shows all messages sent or received by the player. The Message Window is accessed via a Nav Bar icon (see below).
  • The Message Window has two panes. The left pane shows a list of all messages (sent or received) while the right pane shows the contents of the selected message.
  • On the left pane, a message from an empire is labeled as "From {Empire Name} on {xxx}". A message to an empire is labeled, "To {Empire Name} on {xxx}". The list is sorted in reverse chronological order. Unread messages are highlighted. Sent messages are fade (so that received messages are more apparent).
  • The right pane shows the contents of the selected message. The top bar of the right pane shows the sending empire and when the message was sent. Below the message are the following buttons:
    • Reply: This composes a new message addressed to the sender. For now, we don't quote the previous message, but perhaps we keep track of message threads for later.
    • Block: This will prevent the empire from sending more messages to the player. The sending empire will not know that they have been blocked. When this option is selected, a confirmation dialog appears with three options: Block, Block and Report, or Cancel.
  • At the top-left of the Message Window (or somewhere) there is a Compose button to send a new message.
  • We show an icon at the top of the Nav Bar that indicates the number of unread messages the player has. Clicking this button opens up the Message Windows. If a message shows up while the player is playing, we flash this button (or perhaps show the message just below the nav bar, with a button to dismiss and/or open the Message Window).
  • If we have the UI above, we no longer need to show messages as a pop-up on the capital.

Admin UI

We probably need an admin UI to allow seeing messages that have been reported. At minimum we need the Message Window UI accessible to the creator of a game, plus a way to show all reported messages.

Ultimately, however, we probably want a separate UI that allows an administrator/creator to oversee all users and ban/warn as appropriate. We need a separate spec on this. Short term we can implement banning/warnings with AI2 (console interface).

Implementation

The easiest implementation is to have an API to read all messages to/from a given empire and call that API when we open the Message Window.

A more sophisticated design is to have an API to get the list of messages and a separate API call for each message.