{"id":15282426,"url":"https://github.com/strophe/strophejs-plugin-mam","last_synced_at":"2025-10-07T22:02:13.540Z","repository":{"id":16479062,"uuid":"80017938","full_name":"strophe/strophejs-plugin-mam","owner":"strophe","description":"A Strophe.js plugin for message archive management (XEP-0313)","archived":false,"fork":false,"pushed_at":"2024-09-26T21:28:01.000Z","size":19,"stargazers_count":7,"open_issues_count":4,"forks_count":12,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-12-10T01:10:34.081Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strophe.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-25T13:41:22.000Z","updated_at":"2023-10-04T09:16:24.000Z","dependencies_parsed_at":"2022-08-07T08:15:25.038Z","dependency_job_id":null,"html_url":"https://github.com/strophe/strophejs-plugin-mam","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strophe%2Fstrophejs-plugin-mam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strophe%2Fstrophejs-plugin-mam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strophe%2Fstrophejs-plugin-mam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strophe%2Fstrophejs-plugin-mam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strophe","download_url":"https://codeload.github.com/strophe/strophejs-plugin-mam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230511483,"owners_count":18237658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T14:25:55.170Z","updated_at":"2025-10-07T22:02:13.461Z","avatar_url":"https://github.com/strophe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strophe.mam.js\n\nPlugin for [strophe.js](https://www.npmjs.com/package/strophe.js) to provide Message Archiving Management ([XEP-0313]( http://xmpp.org/extensions/xep-0313.html)).\n\nThis plugin requires the [Strophe.RSM](https://github.com/strophe/strophejs-plugin-rsm)\nplugin to be loaded as well.\n\n## Install\n\n    npm install strophejs-plugin-mam\n\n## Usage\n\n### Querying an archive\n\n`connection.mam.query(where, parameters)`\n\n`where` is the JID hosting the archive.  In most cases you will want to \nset this to your own bare JID in order query your personal archive, but \nit could also be a MUC room, an archiving component or a bot.\n\n`parameters` is an object containing parameters for the query.  This can \nhave properties from two and a half categories:\n\n**Handlers**: `onMessage` which gets called for each message received, \nand `onComplete` which is called when the query is completed. \n\n**Filtering**: Half of this is the parameters defined by MAM; `with`, \n`start` or `end`, which allow you to filter the results on who the \nconversation was *with*, and the time range.\n\nAdditionally, parameters from [Result Set Management][RSM] can be \nsupplied.  You would probably be most interested in the `after` and \n`before` properties, which allow you to do pagination of the result set, \nand the `max` property, which allow you to limit the number of items in \neach page.  *Note:* Better RSM integration is on the TODO, you currently\nhave to pick out the `last` or `first` items yourself and pass \nthose as `after` or `before` respectively.\n\n[RSM]: http://xmpp.org/extensions/xep-0059.html\n\n### Example\n\nTo query, for example, your personal archive for conversations with \n`juliet@capulet.com` you could do:\n\n    connection.mam.query(\"you@example.com\", {\n      \"with\": \"juliet@capulet.com\",\n      onMessage: function(message) {\n\t\t\t\tconsole.log(\"Message from \", $(message).find(\"forwarded message\").attr(\"from\"),\n\t\t\t\t\t\": \", $(message).find(\"forwarded message body\").text());\n\t\t\t\treturn true;\n      },\n      onComplete: function(response) {\n\t\t\t\tconsole.log(\"Got all the messages\");\n      }\n\t\t});\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrophe%2Fstrophejs-plugin-mam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrophe%2Fstrophejs-plugin-mam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrophe%2Fstrophejs-plugin-mam/lists"}