Improve formatting of XMPP announcements

Previously private messages and announcements got handled the same way.
This adds a distinct handling for server announcements, which allows
formatting them in a different way. They are now not prefixed with
"Private" anymore and show the announcement subject as well, if one was
set.

Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5268
This was SVN commit r28186.
This commit is contained in:
Dunedan
2024-08-10 05:08:31 +00:00
parent 1a7107e33d
commit a9ea169301
7 changed files with 80 additions and 14 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -821,9 +821,10 @@ void XmppClient::handleMessage(const glooxwrapper::Message& msg, glooxwrapper::M
CreateGUIMessage(
"chat",
"private-message",
msg.subtype() == gloox::Message::MessageType::Headline ? "headline" : "private-message",
ComputeTimestamp(msg),
"from", msg.from().resource(),
"subject", msg.subject(),
"text", msg.body());
}