That's how I code
Apr. 10th, 2008 04:26 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
So, the server normally sends a message to the Roster letting you know your friends have gone offline. This lets the client update it's display and show you that your buddy Fred has left.
Unless, you're in the same chatroom as Fred. Then, the server just notifies the room that you're leaving and expects the Roster to figure it out from there. Only that's not an accurate depiction of what's going on.
I'm leery about touching the server code this close to a release, but my client-side hacks can only solve one problem by creating another.
Off to the server code:
So, we do a bunch of fancy conditionals to determine if we should send that Roster notice? How about we brute force it instead?
Now, I suppose you might get multiple roster notices that the person has left, but you know what? It doesn't matter.
And guess what? It works like a charm.
Brute Force wins again!
Tom
Unless, you're in the same chatroom as Fred. Then, the server just notifies the room that you're leaving and expects the Roster to figure it out from there. Only that's not an accurate depiction of what's going on.
I'm leery about touching the server code this close to a release, but my client-side hacks can only solve one problem by creating another.
Off to the server code:
When DroppingUser { If this { If that { SendRosterNotice() } } }
So, we do a bunch of fancy conditionals to determine if we should send that Roster notice? How about we brute force it instead?
When DroppingUser { SendRosterNotice() }
Now, I suppose you might get multiple roster notices that the person has left, but you know what? It doesn't matter.
And guess what? It works like a charm.
Brute Force wins again!
Tom