collectiveidea/tinder — pull request #55 by ravigadad (2013-04-06 22:16:22+00:00)
Title: Improve user caching, clean up message fetching/parsing API

Hey, thanks for this extremely useful piece of software! We use it every day in several projects for Campfire notifications and iteration status tracking (so we're communicating both ways with our Campfire room all day).

During implementation of our internal status board web app (which just listens to a room and parses messages matching certain regexes), we ran into a few issues:

1. The user cache was seeded on `Room#reload!`, which makes sense, but then never updated if a new user was fetched through parsing a message (acquired via `#listen`, `#recent`, `#search`, or `#transcript`).

2. There was some inconsistency between the hashes returned by the methods listed above for fetching messages from the Campfire connection - this obviously makes it more difficult to write an app that utilizes several different methods for bringing messages into the system, but prefers a single API for dealing with the messages themselves.

3. The documentation was misleading in several places, possibly due to refactoring that neglected documentation. Not a big deal, as the code was pretty clean, but in one case, the documented API was more sensible than the implemented one.

This pull request addresses all three above issues. Unfortunately, it changes the API without backwards compatibility, so I'll understand if it's rejected. Figured I should submit it anyway, since the current API behaves unexpectedly.

Thanks again for the project!