getting from user to hubframe

Technical discussion about the NMDC and <a href="http://dcpp.net/ADC.html">ADC</A> protocol. The NMDC protocol is documented in the <a href="http://dcpp.net/wiki/">Wiki</a>, so feel free to refer to it.

Moderator: Moderators

Locked
dieselmachine
Posts: 36
Joined: 2003-01-19 22:22
Location: Rochester, NY, USA
Contact:

getting from user to hubframe

Post by dieselmachine » 2003-06-08 11:07

I have a function in user.cpp which is intended to output a line of text to my own chat window (not actually get sent to the chat). This involves using the addline fucntion in HubFrame.cpp. Is there a series of links i can do to get from user to hubframe? like, to go from user to client, user->getclient, blah blah. If not, what would be a way for me to get from a user.cpp based function to having a line display in my chat window?

Thanks in advance!

sarf
Posts: 382
Joined: 2003-01-24 05:43
Location: Sweden
Contact:

Post by sarf » 2003-06-08 15:18

One possible way would be to use the Client pointer that is present in the user.

Add this code to the Client class (in the public part of the class, I might add) :

Code: Select all

	void addLine(string line)
	{
		fire(ClientListener::MESSAGE, this, Util::validateMessage(line, true));
	}
It should prove sufficient.

Then you simply do a user->getClient()->addLine("Whatever you want to show up as a line in the HubFrame"); :)

Sarf
---
Time Warner: bringing you the finest in cradle-to-grave thought management.

Locked