From: Evan Prodromou Date: Wed, 15 Jul 2009 19:31:57 +0000 (-0400) Subject: better callback functions for comet plugin X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5b081893a5b7281683b5e78090f754cd50009363;p=quix0rs-gnu-social.git better callback functions for comet plugin --- diff --git a/plugins/Comet/cometupdate.js b/plugins/Comet/cometupdate.js index 432778c190..72cca004b7 100644 --- a/plugins/Comet/cometupdate.js +++ b/plugins/Comet/cometupdate.js @@ -22,8 +22,8 @@ var CometUpdate = function() _favorurl = favorurl; _replyurl = replyurl; _deleteurl = deleteurl; - _cometd.subscribe(timeline, RealtimeUpdater.receive); - $(window).unload(leave); + _cometd.subscribe(timeline, function(message) { RealtimeUpdate.receive(message.data) }); + $(window).unload(function() { _cometd.disconnect(); } ); } } }();