summaryrefslogtreecommitdiffstats
path: root/src/CompositeChat.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-19 22:16:29 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-19 22:16:29 +0200
commit3a9543178abb7500aff65e09f054c28200ca6cac (patch)
tree098503b8bce507fcffb87e9b4ed3e2cc44aa4d86 /src/CompositeChat.h
parentAdded client translation to achievements (diff)
downloadcuberite-3a9543178abb7500aff65e09f054c28200ca6cac.tar
cuberite-3a9543178abb7500aff65e09f054c28200ca6cac.tar.gz
cuberite-3a9543178abb7500aff65e09f054c28200ca6cac.tar.bz2
cuberite-3a9543178abb7500aff65e09f054c28200ca6cac.tar.lz
cuberite-3a9543178abb7500aff65e09f054c28200ca6cac.tar.xz
cuberite-3a9543178abb7500aff65e09f054c28200ca6cac.tar.zst
cuberite-3a9543178abb7500aff65e09f054c28200ca6cac.zip
Diffstat (limited to 'src/CompositeChat.h')
-rw-r--r--src/CompositeChat.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/CompositeChat.h b/src/CompositeChat.h
index a0264d864..209d9d925 100644
--- a/src/CompositeChat.h
+++ b/src/CompositeChat.h
@@ -47,6 +47,7 @@ public:
ePartType m_PartType;
AString m_Text;
AString m_Style;
+ AString m_AdditionalStyleData;
cBasePart(ePartType a_PartType, const AString & a_Text, const AString & a_Style = "");
@@ -169,7 +170,7 @@ public:
void ParseText(const AString & a_ParseText);
/** Sets the message type, which is indicated by prefixes added to the message when serializing. */
- void SetMessageType(eMessageType a_MessageType);
+ void SetMessageType(eMessageType a_MessageType, const AString & a_AdditionalMessageTypeata = "");
/** Adds the "underline" style to each part that is an URL. */
void UnderlineUrls(void);
@@ -178,6 +179,9 @@ public:
/** Returns the message type set previously by SetMessageType(). */
eMessageType GetMessageType(void) const { return m_MessageType; }
+
+ /** Returns additional data pertaining to message type, for example, the name of a mtPrivateMsg sender */
+ AString GetAdditionalMessageTypeData(void) const { return m_AdditionalMessageTypeData; }
/** Returns the text from the parts that comprises the human-readable data.
Used for older protocols that don't support composite chat
@@ -199,6 +203,9 @@ protected:
/** The message type, as indicated by prefixes. */
eMessageType m_MessageType;
+ /** Additional data pertaining to message type, for example, the name of a mtPrivateMsg sender */
+ AString m_AdditionalMessageTypeData;
+
/** Adds a_AddStyle to a_Style; overwrites the existing style if appropriate.
If the style already contains something that a_AddStyle overrides, it is erased first. */