taksan/skype-java-api — pull request #47 by razum2um (2014-06-27 19:59:23+00:00)
Title: handle properly long inactivity pauses and recieving duplicates

this resolves #30 & #46

inspired by https://github.com/jmandel/sevabot/commit/29f21c1430ef28511b20dbfd53a1fa1c04fb0469
also see: https://github.com/opensourcehacker/sevabot/issues/68 && https://github.com/bkmeneguello/sevabot/commit/f783e9849e1856ea812567f9eacc46b50f211a93

the problem is, that after some time of inactivity skype **won't** call "CHATMESSAGE 19017 STATUS RECEIVED" it calls **only** "CHAT #.../... ACTIVITY_TIMESTAMP 1403896553".
I consider that as skype bug.

besides of that, patch is handling messages, which are coming while bot is not started,
for details why HashMap & lastReceivedId wasn't working see comment around ```bytes:```

**Please**, review this PR (and idea of lastReceivedId) from the point of concurrency!
Now *without that id's check fireMessageSent would always be called twice now* as it's called by ```getMissedMessages```, too (besides normal RECIEVED)

I think when bot would talk to many people (more than 100 in my case) this wouldn't help, would it?
The other approach with looking up the status inside ```ChatMessageConnectorListener#messageReceived````
would probably also wrong, as it's asynchronous
Any thoughts?