acomminos / Jumble

An Android service implementation of the Mumble protocol.
GNU General Public License v3.0
90 stars 51 forks source link

Duped messages due to multiple addTCPMessageHandlers(mModelHandler) calls #3

Closed JordanMilne closed 9 years ago

JordanMilne commented 9 years ago

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.

acomminos commented 9 years ago

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.

acomminos commented 9 years ago

Fixed in 74ed054de1d2542debc0d6690d3977015c92e709.