Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the name of the person you are writing PMs to #3116

Closed
DorpsGek opened this issue Aug 11, 2009 · 7 comments
Closed

Show the name of the person you are writing PMs to #3116

DorpsGek opened this issue Aug 11, 2009 · 7 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Akozor opened the ticket and wrote:

This patch changes the "[Private]" tag to a "[To Nick]" tag.
Useful in connection with the quick reply hotkey patch.

Attachments

Reported version: Version?
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/3116
@DorpsGek
Copy link
Member Author

Akozor wrote:

I forgot to add version; It's trunk (r17150)


This comment was imported from FlySpray: https://bugs.openttd.org/task/3116#comment6468

@DorpsGek
Copy link
Member Author

SmatZ wrote:

As I said yesterday:
+ NetworkClientInfo *ci = NetworkFindClientInfoFromClientID((ClientID)this->dest);
can be const
when a client disconnects while query is open, it crashes
when client has name longer than ~4 characters, it's truncated


This comment was imported from FlySpray: https://bugs.openttd.org/task/3116#comment6470

@DorpsGek
Copy link
Member Author

Akozor wrote:

I must have missed that.

I don't have access to editing this task or the file, but if you replace:

  if (this->dtype == DESTTYPE_CLIENT) {
  	NetworkClientInfo *ci = NetworkFindClientInfoFromClientID((ClientID)this->dest);
  	assert(ci->client_name != NULL);
  	SetDParamStr(0, ci->client_name);
  }

with:

  if (this->dtype == DESTTYPE_CLIENT) {
  	const NetworkClientInfo *ci = NetworkFindClientInfoFromClientID((ClientID)this->dest);
  	if (ci == NULL || ci->client_name == NULL) {
  		delete this;
  		return;
  	}
  	SetDParamStr(0, ci->client_name);
  }

..then the crash issue should be resolved. Personally I think the truncation is fine as I wouldn't want long names to take up my typing space. The first 5 characters as displayed now is enough to distinguish most nicks from each other which is the purpose of the function. I suppose it could easily be edited to display the full nick if that is wanted?


This comment was imported from FlySpray: https://bugs.openttd.org/task/3116#comment6471

@DorpsGek
Copy link
Member Author

Akozor wrote:

Oh. I see I can upload more files at least. Here's the updated patch.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3116#comment6472

@DorpsGek
Copy link
Member Author

SmatZ wrote:

It would be better to have the window deleted when a client disconnects. There should be already code for that somewhere.
The problem with this patch is that in English, [To SmatZ] is displayed as [To Sma...], but in other laguages it could be even worse (czech - [Pro Sm...], some other language [huhuhu ...])


This comment was imported from FlySpray: https://bugs.openttd.org/task/3116#comment6473

@DorpsGek
Copy link
Member Author

Akozor wrote:

True. A quick workaround is simply to remove "To" and just have the nick displayed in that box. That would save some translation work as well.
I'm leaving tomorrow, so I can't work more on this patch, but if you or anyone else feels like properly fixing the destruction of the window it should be ready for implementation. I can only speak for myself, but I've been wanting this feature for quite some time along with the hotkey for it.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3116#comment6474

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 7, 2009

Rubidium closed the ticket.

Reason for closing: Implemented

With a different implementation due to massive GUI changes though.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3116

@DorpsGek DorpsGek closed this as completed Oct 7, 2009
@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant