Skip to content

Instantly share code, notes, and snippets.

@dristic
Created May 28, 2013 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dristic/5666198 to your computer and use it in GitHub Desktop.
Save dristic/5666198 to your computer and use it in GitHub Desktop.
Adding history to PubNub Messenger.
pubnub.history({
channel: chatChannel,
limit: 100
}, function (messages) {
messages = messages[0];
messages = messages || [];
for(var i = 0; i < messages.length; i++) {
handleMessage(messages[i], false);
}
$(document).scrollTop($(document).height());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment