Skip to content

Instantly share code, notes, and snippets.

View knixeur's full-sized avatar

Guillermo Bonvehí knixeur

  • Argentina
View GitHub Profile
@knixeur
knixeur / converse.join.muc.on.click.js
Created April 16, 2015 04:18
Join a room by clicking a button using new rooms API
// Bind on click event on page startup using converse's jQuery
converse.env.jQuery(function($) {
$('#join-button').on('click', function() {
converse.rooms.open('[email protected]');
});
});
converse.initialize({
....
@knixeur
knixeur / converse.autojoin.js
Last active August 29, 2015 14:14
A simple plugin that let's you open chats or join rooms when converse is initialized
function converseAutoJoinChatPlugin( converse ) {
var jids = [ '[email protected]' ];
converse.on('ready', function() {
var _transform = function (jid) {
var chatbox = converse.chatboxes.get(jid);
if (!chatbox) {
var roster_item = converse.roster.get(jid);
if (roster_item === undefined) {
// Assume MUC
converse.chatboxes.create({