Adding Timestamps on public messages.

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

JSable
Posts: 4
Joined: 2003-05-11 04:22

Adding Timestamps on public messages.

Post by JSable » 2003-05-21 02:19

Ok, so you can get a little background perspective on me right off. :)

I taught myself C long long ago when I was a teenager. I got more into 3D graphics about the time C++ came out so never really migrated to C++.

Now, I CAN actually follow the code to some extent. But what I'm finding hard to figure out is where specific functions of the code are located. I can successfully compile the source and it runs fine with no modifications, so at least that's a good start.

As the subject describes. What I wanted to add was basicly just to simply timestamp messages recieved in the public channel of the hubs. But for the life of me I can't find where the function is that listens and then sends the username and message to the public frame(window). In case I'm not being very clear due to my lack of C++ terminology. Here's a small example..

<JSable> hey, does anyone have the url for dc++'s forums?
<arnetheduck> yeah, its.. dcplusplus.sourceforge.net/forum

and what I'm looking to do would be this...

[03:18] <JSable> hey, does anyone have the url for dc++'s forums?
[03:24] <arnetheduck> yeah, its.. dcplusplus.sourceforge.net/forum


Something I know is so trivially easy. If I could just find the damn function call that prints that to the frame. :)

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2003-05-21 02:31

it's already implemented =)

see the options,
or type /ts in any chatwindow
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2003-05-21 02:38

but.. to satisfy your programming curiousity:

for mainchat, it's located in windows/HubFrame.cpp

Code: Select all

void HubFrame::addLine(const string& aLine) {

[snip]

   if(timeStamps) {
      ctrlClient.AppendText(("\r\n[" + Util::getShortTimeString() + "] " + aLine).c_str());
   } else {
      ctrlClient.AppendText(("\r\n" + aLine).c_str());
   }

[snip]

}

the getShortTimeString() is a static member function of the Util class (see client/Util.h)

roughly the same thing happens in windows/PrivateFrame.cpp
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

JSable
Posts: 4
Joined: 2003-05-11 04:22

Post by JSable » 2003-05-21 03:10

Well, damn me to hell. :) But thank you very much for the clarification on it's location too. This was just one of my more wanted features.

Who is online

Users browsing this forum: Google [Bot] and 0 guests