acomminos / Jumble

An Android service implementation of the Mumble protocol.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duped messages due to multiple addTCPMessageHandlers(mModelHandler) calls

JordanMilne opened this issue · comments

JumbleConnection.addTCPMessageHandlers(mModelHandler) gets called in both JumbleService.connect() and JumbleService.connectionSynchronized(), putting JumbleService.mModelHandler in JumbleConnection.mTCPHandlers twice, and causing the handler to be called twice for every message.

The easiest way to repro this is with text messages in Plumble master. For each one you receive, you'll have two in the chat view.

If the handler needs to be added in both places, checking if a handler is in JumbleConnection.mTCPHandlers before actually adding it in JumbleConnection.addTCPMessageHandlers() might work.

Nice catch! I've been doing some behind the scenes changes related to IPC lately and haven't tested any live builds. Looks like it was caused by a sloppy copy and paste.

Fix incoming.