When I receive a new message, when the window is closed, the plugin loads this new message as an old message.
I think that happens cause, when the new message comes, the logger adds the message to the log, and when session.logger.get_chats() is called, it loads this message.
To fix, I think session.logger.get_chats, should run before the logger adds this new message.
I tried to fix checking if the message's timestamp equals or it's similar to the actual timestamp and del results[-1] inside _on_chats_ready, but that's too ugly to do . Also, if the user has configured to get 7 messages, will show only 6 so...
I also tried using get_chats_between, but I think would be ugly to 'cause I have to load the time from another message to now and load these messages, it fails...
I'm studying python today, I found this bug and tried to find a way to fix, but I guess I'm not to good with py, haha
When I receive a new message, when the window is closed, the plugin loads this new message as an old message.
I think that happens cause, when the new message comes, the logger adds the message to the log, and when session.logger.get_chats() is called, it loads this message. To fix, I think session.logger.get_chats, should run before the logger adds this new message.
I tried to fix checking if the message's timestamp equals or it's similar to the actual timestamp and del results[-1] inside _on_chats_ready, but that's too ugly to do . Also, if the user has configured to get 7 messages, will show only 6 so...
I also tried using get_chats_between, but I think would be ugly to 'cause I have to load the time from another message to now and load these messages, it fails...
I'm studying python today, I found this bug and tried to find a way to fix, but I guess I'm not to good with py, haha