]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better callback functions for comet plugin
authorEvan Prodromou <evan@controlyourself.ca>
Wed, 15 Jul 2009 19:31:57 +0000 (15:31 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Wed, 15 Jul 2009 19:31:57 +0000 (15:31 -0400)
plugins/Comet/cometupdate.js

index 432778c1905576e6d01995934a5c0641c03521b8..72cca004b7b5f8195fc165aff261e0b08c2104b8 100644 (file)
@@ -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(); } );
           }
      }
 }();