linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #05287
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2849: fix timestamps, add some doc about dcpp::ChatMessage
------------------------------------------------------------
revno: 2849
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2012-02-02 20:06:08 +0100
message:
fix timestamps, add some doc about dcpp::ChatMessage
modified:
dcpp/ChatMessage.cpp
dcpp/ChatMessage.h
win32/HtmlToRtf.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/ChatMessage.cpp'
--- dcpp/ChatMessage.cpp 2012-02-01 16:54:41 +0000
+++ dcpp/ChatMessage.cpp 2012-02-02 19:06:08 +0000
@@ -66,7 +66,7 @@
ChatMessage::ChatMessage(const string& text, const OnlineUser* from,
const OnlineUser* to, const OnlineUser* replyTo,
- bool thirdPerson, time_t timestamp) :
+ bool thirdPerson, time_t messageTimestamp) :
from(from->getUser()),
to(to ? to->getUser() : nullptr),
replyTo(replyTo ? replyTo->getUser() : nullptr),
=== modified file 'dcpp/ChatMessage.h'
--- dcpp/ChatMessage.h 2012-02-01 16:26:37 +0000
+++ dcpp/ChatMessage.h 2012-02-02 19:06:08 +0000
@@ -27,21 +27,36 @@
using std::string;
+/** This class holds information about one chat message. It is sent with a ClientListener::Message
+notification so information about the hub itself should be known.
+On creation, the class reads message information it has received from the underlying protocol and
+formats it in 2 ways:
+- One plain text string, suitable for logs, tooltips, etc.
+- One HTML string. The tags in the HTML string are limited to those marked as "phrasing content" in
+the HTML5 spec. Each part of the message (timestamp, nick, etc) is enclosed in a <span> tag in
+order to facilitate identification of the part.
+DC++ formats the strings first according to settings, then hands them over to plugins for further
+processing. */
struct ChatMessage {
ChatMessage(const string& text, const OnlineUser* from,
const OnlineUser* to = nullptr, const OnlineUser* replyTo = nullptr,
- bool thirdPerson = false, time_t timestamp = 0);
+ bool thirdPerson = false, time_t messageTimestamp = 0);
+ /** Plain text message. */
string message;
+ /** HTML representation of the message. */
string htmlMessage;
UserPtr from;
UserPtr to;
UserPtr replyTo;
+ /** Time when this structure was created (ie when the message was received by DC++). */
time_t timestamp;
+ /** [ADC only] Whether the message has been written in third person mode. */
bool thirdPerson;
+ /** [ADC only] Time when the message was initially sent. */
time_t messageTimestamp;
};
=== modified file 'win32/HtmlToRtf.cpp'
--- win32/HtmlToRtf.cpp 2012-02-01 19:04:48 +0000
+++ win32/HtmlToRtf.cpp 2012-02-02 19:06:08 +0000
@@ -128,13 +128,6 @@
state = Declaration;
break;
}
-
- default:
- {
- // unknown style
- state = Declaration;
- break;
- }
}
}
}