Bug - Fixed Minimize main interface to system tray resizes window

Sentrion

Member
I've been encountering this bug for the last few weeks, and even after updating to r8671 I still encounter it. I'm using Windows 7 with Java version 6, update 21 (the latest). I have also had a friend reproduce this bug using the same versions of KoLmafia and Windows.

The bug involves the "minimize main interface to system tray" feature. It appears that whenever I resize my main window, minimize it, and subsequently open it again, it resizes itself. Sometimes it will return to the size it was before I manually resized it, and sometimes it will be a completely different size. In addition, it will often reposition itself on the screen, although I think that part has something to do with where the top-left corner of the window is upon manually resizing (the new auto-resized window seems to match with that corner).

Before I continue, huge apologies if that's entirely too confusing. I realize I used the word 'size' and 'resize' about 8 billion times too many.

Anyway, this problem doesn't only seem to occur when opening from the tray, but anytime you try to refocus to the main window using the tray icon. For example, the window could already be in focus, and manually resized, and if you click on the tray icon, it will "open" again, but at a new size. Thus, minimizing is not strictly necessary.

I would include some screenshots, but I think it'd make a lot more sense to experience it firsthand, if you're able to reproduce the bug.

On a sidenote, has anyone ever tried private messaging a KoLmafia user the word 'update'? The results are...interesting.
 

Ethelred

Member
On a sidenote, has anyone ever tried private messaging a KoLmafia user the word 'update'? The results are...interesting.

The "update" private message is intended behaviour, since it is specially coded to do that. I can't answer why that functionality is there, but it is by design.
 

Sentrion

Member
The "update" private message is intended behaviour, since it is specially coded to do that. I can't answer why that functionality is there, but it is by design.

Yes, I know. I didn't mean for it to actually be part of the bug report. Just didn't feel the need to start a new thread for that, and I couldn't find one that currently existed.
 

heeheehee

Developer
Staff member
From the source code: "sometimes clannies want to take advantage of KoLmafia's automatic chat logging. In that case... "

I guess so a clannie can catch up on chat right away?
 

Grotfang

Developer
Exactly it. Before r8583 the update message didn't even get through to the chat pane, but I assumed that was unintended behaviour and changed it.

Note that only clan members will be able to request an update anyway (although the way mafia stores member info means this isn't 100% accurate, but is close enough). The biggest problem I have with this feature is it doesn't send names of the speaker, only the message, so the kmail return is a little bit garbled.

The final thing I will note is that this only sends the latest 30 messages. It does not reveal a day worth of chat. It really is there simply to allow an individual to catch up on the latest conversation.
 

holatuwol

Developer
Minimizing to the system tray should work a little bit better with revision 8680.

As for the "update" command, what it was intended to do is described here. It lost the timestamps and message sender after the chat refactoring, but that's been readded with revision 8679. The request for "update" was originally suppressed (I used to get /msg update a lot from clanmates and I didn't want tabs constantly popping up), but I can see why people would want to see those messages.
 

Sentrion

Member
I just grabbed r8687, and all appears to be working. Many thanks!

One small issue with the 'update' feature: I only tested this once, but in the kmail I received, an HTML space shows up after the timestamp (" "). In addition, there is an actual space after this and before the names, except for one name:

Code:
[13:15]  Sentrion: [blah blah]
[13:15] Ominous Sauceror: [blah blah]

I have a second similarly-named character in the clan which that also happened with (Ominous Buffer).

I'm not sure if you actually care enough to fix something that small or not. Anyway, thank you again!
 

Grotfang

Developer
One small issue with the 'update' feature: I only tested this once, but in the kmail I received, an HTML space shows up after the timestamp (" ").

That's because we add it in line 149 of ChatFormatter.java. Don't want to subvert anyone else who wants to fix this, but if no-one's claimed this by Tuesday I'll sort it (sorry for making you wait, but need to work out where the best place to put the Pattern to act as a matcher is -- feels messy to plonk it into ChatManager.java and too niche to add to KoLConstants.java).
 

Sentrion

Member
I wasn't paying attention when playing around yesterday, but today I noticed that the timestamps in the kmail all read the same: the time the kmail was sent out. So although I knew messages to be hours apart, they were all stamped the same.

Is it alright that I keep posting these findings in this thread, or should I create a new one?
 

Grotfang

Developer
Yeah, since it looks like there's more than just one (simple) issue going on here, probably best to start a new thread with both of these issues in.
 

Grotfang

Developer
I wasn't paying attention when playing around yesterday, but today I noticed that the timestamps in the kmail all read the same: the time the kmail was sent out.

Until now timestamps were generated as the elements of a chat message were strung together in ChatFormatter. For logs this wasn't an issue, for update (where messages are formatted at a variable time, especially significant in active chats) it was. In r8692 I have changed the timestamp so it is added as a message is parsed and is a variable of the chat message itself. This means we can retain a single function for generating logs and update messages (seems silly not to since the are the same format).

r8693 removes  . On looking at the code I realised within the same method we use displayHTML.append( " " ); [line 210] so really this is just making the code uniform (as well as prettifying the output).
 
Last edited:

mekkanik

New member
Um... Dunno if I should be starting a new thread for this... but if I turn on the 'use system tray icon' option, Mafia doesnt start. OS: Windows 7.
 

Theraze

Active member
Yes... because your bug isn't about resizing the window, but mafia not starting. That would be a different bug.
 
Top