Fire notification only if message was actually inserted

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>
Mark messages as not delivered also when not waiting for them

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>
Fix send pending delivery receipts to correct messages

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>
Handle unavailanle presence and retrieve last seen timestamp from database

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>
Compile against Smack 4.1.0-alpha6 and make release debuggable

For the time being of tigase client testing, releases will be
also debuggable.

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>