{"action":"created","issue":{"url":"https://api.github.com/repos/strophe/strophejs-plugins/issues/37","labels_url":"https://api.github.com/repos/strophe/strophejs-plugins/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/strophe/strophejs-plugins/issues/37/comments","events_url":"https://api.github.com/repos/strophe/strophejs-plugins/issues/37/events","html_url":"https://github.com/strophe/strophejs-plugins/pull/37","id":42235654,"number":37,"title":"Support v0.3 of XEP-0313 (MAM)","user":{"login":"Destreyf","id":967304,"avatar_url":"https://avatars.githubusercontent.com/u/967304?v=3","gravatar_id":"","url":"https://api.github.com/users/Destreyf","html_url":"https://github.com/Destreyf","followers_url":"https://api.github.com/users/Destreyf/followers","following_url":"https://api.github.com/users/Destreyf/following{/other_user}","gists_url":"https://api.github.com/users/Destreyf/gists{/gist_id}","starred_url":"https://api.github.com/users/Destreyf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Destreyf/subscriptions","organizations_url":"https://api.github.com/users/Destreyf/orgs","repos_url":"https://api.github.com/users/Destreyf/repos","events_url":"https://api.github.com/users/Destreyf/events{/privacy}","received_events_url":"https://api.github.com/users/Destreyf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-09-08T19:47:33Z","updated_at":"2015-07-15T16:38:17Z","closed_at":"2014-09-09T13:07:47Z","pull_request":{"url":"https://api.github.com/repos/strophe/strophejs-plugins/pulls/37","html_url":"https://github.com/strophe/strophejs-plugins/pull/37","diff_url":"https://github.com/strophe/strophejs-plugins/pull/37.diff","patch_url":"https://github.com/strophe/strophejs-plugins/pull/37.patch"},"body":"A few changes happened with the v0.3 of the XEP-0313 specification, including using field type=\"field to search\" in order to do the work needed.\r\n\r\nThis is still compliant with XEP-0059 (Result Set Management aka RSM)."},"comment":{"url":"https://api.github.com/repos/strophe/strophejs-plugins/issues/comments/121672351","html_url":"https://github.com/strophe/strophejs-plugins/pull/37#issuecomment-121672351","issue_url":"https://api.github.com/repos/strophe/strophejs-plugins/issues/37","id":121672351,"user":{"login":"Destreyf","id":967304,"avatar_url":"https://avatars.githubusercontent.com/u/967304?v=3","gravatar_id":"","url":"https://api.github.com/users/Destreyf","html_url":"https://github.com/Destreyf","followers_url":"https://api.github.com/users/Destreyf/followers","following_url":"https://api.github.com/users/Destreyf/following{/other_user}","gists_url":"https://api.github.com/users/Destreyf/gists{/gist_id}","starred_url":"https://api.github.com/users/Destreyf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Destreyf/subscriptions","organizations_url":"https://api.github.com/users/Destreyf/orgs","repos_url":"https://api.github.com/users/Destreyf/repos","events_url":"https://api.github.com/users/Destreyf/events{/privacy}","received_events_url":"https://api.github.com/users/Destreyf/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T16:38:17Z","updated_at":"2015-07-15T16:38:17Z","body":"@yashwanthbabu below is a copy of my code that i use specifically to interact with MAM via the v0.3 plugin\r\n\r\n```javascript\r\nvar q = {\r\n\tonMessage: function(message) {\r\n\t\ttry {\r\n\t\t\tvar id = message.querySelector('result').getAttribute('id');\r\n\t\t\tvar fwd = message.querySelector('forwarded');\r\n\t\t\tvar d = fwd.querySelector('delay').getAttribute('stamp');\r\n\t\t\tvar msg = fwd.querySelector('message');\r\n\r\n\t\t\tvar msg_data = {\r\n\t\t\t\tid:id,\r\n\t\t\t\twith: data.with,\r\n\t\t\t\ttimestamp: (new Date(d)),\r\n\t\t\t\ttimestamp_orig: d,\r\n\t\t\t\tfrom: Strophe.getBareJidFromJid(msg.getAttribute('from')),\r\n\t\t\t\tto: Strophe.getBareJidFromJid(msg.getAttribute('to')),\r\n\t\t\t\ttype: msg.getAttribute('type'),\r\n\t\t\t\tbody: msg.getAttribute('body'),\r\n\t\t\t\tmessage: Strophe.getText(msg.getElementsByTagName('body')[0]),\r\n\t\t\t\tavatar:'images/default_avatar_image.png'\r\n\t\t\t};\r\n\t\t\tconsole.log('xmpp.history.message',msg_data);\r\n\t\t} catch(err){\r\n\t\t\tif(typeof(err) == 'TypeError'){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconsole.log(err.stack)\r\n\t\t\t\t} catch(err2){\r\n\t\t\t\t\tconsole.log(err,err2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\tonComplete: function(response) {\r\n\t\tconsole.log('xmpp.history.end',{query:q,data:data,response:response});\r\n\t}\r\n};\r\n\r\n// MAM Keys\r\nq.with = data.with;\r\n\r\nif(typeof(data.start) !== 'undefined'){\r\n\tq.start = data.start;\r\n}\r\nif(typeof(data.end) !== 'undefined'){\r\n\tq.end = data.end;\r\n}\r\n\r\n// RSM Keys\r\nif(typeof(data.before) !== 'undefined'){\r\n\tq.before = data.before;\r\n}\r\n\r\nif(typeof(data.after) !== 'undefined'){\r\n\tq.after = data.after;\r\n}\r\n\r\nconsole.log('xmpp.history.start',{query:q});\r\nconn.mam.query(Strophe.getBareJidFromJid(conn.jid), q);\r\n```\r\n\r\nI am using [Prosody](http://prosody.im/) with [mod_mam](https://code.google.com/p/prosody-modules/wiki/mod_mam) and its working perfectly according to the v0.3 spec."}}