Moved blocking call out of event handler. Fixes issue #3611961.

This commit is contained in:
akwizgran
2013-04-29 12:56:58 +01:00
parent f8d9170a25
commit 458258f2ff

View File

@@ -135,8 +135,7 @@ abstract class DuplexConnection implements DatabaseListener {
public void eventOccurred(DatabaseEvent e) {
if(e instanceof ContactRemovedEvent) {
ContactRemovedEvent c = (ContactRemovedEvent) e;
// FIXME: Listeners should not block
if(contactId.equals(c.getContactId())) dispose(false, true);
if(contactId.equals(c.getContactId())) writerTasks.add(CLOSE);
} else if(e instanceof GroupMessageAddedEvent) {
if(canSendOffer.getAndSet(false))
dbExecutor.execute(new GenerateOffer());