Permalink
Browse files

connector, strophe.pubsub: rsmMax=1 for status node

  • Loading branch information...
1 parent 5324f4b commit 9a15b5a2136641f64ec3903f50d410ed76dac66c @astro astro committed Feb 27, 2012
Showing with 9 additions and 4 deletions.
  1. +5 −1 src/handlers/connector.coffee
  2. +4 −3 src/vendor/strophe.pubsub.js
@@ -108,8 +108,12 @@ class exports.Connector extends Backbone.EventHandler
@work_enqueue ->
done()
callback? new Error("Cannot get posts")
+ # Only most recent status is interesting for the status
+ # node. TODO: this amount parameter is better moved up
+ # towards the views that actually display it.
+ rsmMax = if /\/status/.test(nodeid) then 1 else 30
@connection.buddycloud.getChannelPosts(
- { node: nodeid, rsmAfter, itemIds }, success, error, @connection.timeout)
+ { node: nodeid, rsmMax, rsmAfter, itemIds }, success, error, @connection.timeout)
get_node_metadata: (nodeid, callback) =>
@request (done) =>
@@ -445,9 +445,10 @@ Extend connection object to have plugin name 'pubsub'.
}
}
iq.up()
- .c('set', { xmlns: Strophe.NS.RSM })
- .c('max').t("40")
- .up();
+ .c('set', { xmlns: Strophe.NS.RSM });
+ if (options.rsmMax)
+ iq.c('max').t("" + options.rsmMax)
+ .up();
if (options.rsmAfter)
iq.c('after').t(options.rsmAfter);

0 comments on commit 9a15b5a

Please sign in to comment.