Bug - Fixed nulls in chat

Aankhen

Member
I’m seeing nulls instead of timestamps next to non-messages in chat. I think it must have been r8692 or r8693 that did it, since everything was fine before I rebuilt today. Here’s what it looks like:
nulls in chat.png

EDIT:
Just to clarify, this is in the Mafia chat, not the Relay Browser.
 
Last edited:

NataliaM

New member
It's doing it for me, and I'm using build 8702 currently.
mafianull.jpg
 

Theraze

Active member
Probably 8692, since that's the one that changed it.

Okay, uploaded a patch that might fix it... I don't chat, so I don't know. Basically, made it so that getTimestamp checks if timestamp is defined, if so, it returns timestamp. If it's null, it returns right now. Should fix things without causing new problems.

Edit: Removed bad patch.
 
Last edited:

Grotfang

Developer
Theraze... I don't think that patch will compile.

Basically, what used to happen is all timestamps were generated on the fly. This worked fine when you were looking at content that happened in real time, but when Hola fixed the update function to return timestamps as well as the messages (and author) he didn't add a way to associate a timestamp with the message. My "fix" first time round was half-assed and just added a stamp for normal chat messages. Turns out I didn't include EVERY OTHER chat message in the game (including event messages that KoLmafia generates. Sorry about that.

While Theraze's concept (if not patch) would work on a superficial level (we don't currently retrieve anything other than chat messages at a later point, so timestamps wouldn't appear weirdly) it would mean if we ever did decide to retrospectively retrieve them, we wouldn't be able to. My fix will allow us to do that. If anyone on the dev side of things disagrees with that, then just shout -- I'll happily change it.

Tl;dr: fixed in r8703
 

Theraze

Active member
Sad, but true. Was on a slow newly reimaged laptop on a remote site installing windows updates while doing this, hence didn't actually get to test compile. And, as always happens in those cases, it failed misterably. Suppose I should probably have forced it to have a strlen check or something like that... Ah well. Least it's fixed now. I'd better revert that bad one for me so it works properly.
 

Aankhen

Member
Grotfang: Thanks for the quick fix. It wasn’t exactly critical, it just triggered my irrational need for symmetry. :p

Theraze: Thanks for trying!
 

Grotfang

Developer
Oh, please be critical. It was a bad patch that needed fixing! I just wanted to log what I had done and why, and I figured that would be better placed in the tracker than in the commit log message.
 
Top