Skip to content

Instantly share code, notes, and snippets.

@kevb
Created October 13, 2014 03:43
Show Gist options
  • Save kevb/555fa5d47a91943ba010 to your computer and use it in GitHub Desktop.
Save kevb/555fa5d47a91943ba010 to your computer and use it in GitHub Desktop.
//Include strophe, strophe.mam, strohpe.rsm
var jabber_service = "...";
var my_test_jid = "...";
var password = "...";
var my_test_target_jid = "...";
var connection = new Strophe.Connection( jabber_service );
this.connection.connect( my_test_jid, password, function (status) {
if (status === Strophe.Status.CONNECTED) {
connection.mam.query(my_test_jid, {
with: my_test_target_jid,
before: "",
onMessage: (function(message) {
console.log('archive message recieved', message);
return true;
})
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment