Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

strophejs-plugin-roster

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strophejs-plugin-roster

A strophe.js plugin for Roster Versioning (XEP-0237).

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

strophejs-plugin-roster

strophe.roster.js is a plugin to provide Roster Versioning (XEP-0237).

Install

npm install strophejs-plugin-roster

Usage

Make sure you include Strophe first.

You should first initialize and authorize the plugin, then you can subscribe to presence updates for the people in your roster.

Init connection

# `connection` is Strophe.Connection
connection.roster.init(connection)

var roster;
connection.roster.get(function (result) {
  roster = result;
});

Subscribe to updates

# a jid from your roster
var jid = 'username@your_xmpp_server';

// Subscribe to updates for the given JID
connection.roster.subscribe(jid, 'Online', 'Nick');

// Authorize the given JID to get updates from you
connection.roster.authorize(jid, 'Online');

Update nick

connection.roster.update(jid, 'My Nick');

API

.authorize(jid, message)

.subscribe(jid, message, nick)

.unsubscribe(jid, message)

.add(jid, name, groups, callback)

.update(jid, callback)

.remove(jid, callback)

.findItem(jid)

.removeItem(jid)

FAQs

Package last updated on 21 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc