Skip to content

Commit

Permalink
Support 'max_items'.
Browse files Browse the repository at this point in the history
Fixes #21
  • Loading branch information
Lloyd Watkin committed Sep 17, 2013
1 parent 3b4c438 commit ded8008
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,10 @@ PubSub.prototype.getItems = function(data, callback) {
return this._clientError("Missing 'node' key", data, callback)

var self = this
var attrs = { to: data.to, node: data.node }
if (data.maxItems) attrs.maxItems = data.maxItems
var stanza = this._getStanza(
{ to: data.to, node: data.node }, 'get', 'items', this.NS_PUBSUB
attrs, 'get', 'items', this.NS_PUBSUB
)
if (data.id) {
var itemIds = data.id
Expand Down Expand Up @@ -546,6 +548,7 @@ PubSub.prototype._getStanza = function(data, type, element, namespace) {
if (data.node) attributes.node = data.node
if (data.jid) attributes.jid = data.jid
if (data.id) attributes.subid = data.id
if (data.maxItems) attributes.max_items = data.maxItems
return new builder.Element(
'iq',
{ to: data.to, type: type, id: this._getId() }
Expand Down

0 comments on commit ded8008

Please sign in to comment.