Code Monkey home page Code Monkey logo

node-simple-xmpp's Introduction

DEPRECATED

This project is deprecated. Please consider using xmpp.js.


node-simple-xmpp

Simple High Level NodeJS XMPP Library

Install

$ npm install simple-xmpp

Example

var xmpp = require('simple-xmpp');

xmpp.on('online', function(data) {
	console.log('Connected with JID: ' + data.jid.user);
	console.log('Yes, I\'m connected!');
});

xmpp.on('chat', function(from, message) {
	xmpp.send(from, 'echo: ' + message);
});

xmpp.on('error', function(err) {
	console.error(err);
});

xmpp.on('subscribe', function(from) {
	if (from === '[email protected]') {
		xmpp.acceptSubscription(from);
	}
});

xmpp.connect({
	jid: username@gmail.com,
	password: password,
	host: 'talk.google.com',
	port: 5222
});

xmpp.subscribe('[email protected]');
// check for incoming subscription requests
xmpp.getRoster();

Documentation

Events

Online

Event emitted when successfully connected. Callback is passed an object containing information about the newly connected user.

xmpp.on('online', function(data) {
	console.log('Yes, I\'m online');
});

Close

event where the connection has been closed

xmpp.on('close', function() {
	console.log('connection has been closed!');
});

Chat

Event emitted when somebody sends a chat message to you (either a direct message or a private message from a MUC)

xmpp.on('chat', function(from, message) {
	console.log('%s says %s', from, message);
});

Chat State

event emitted when a buddys chatstate changes [ 'active', 'composing', 'paused', 'inactive', 'gone' ]

xmpp.on('chatstate', function(from, state) {
	console.log('% is currently %s', from, state);
});

Group Chat

event where emits when somebody sends a group chat message to you

xmpp.on('groupchat', function(conference, from, message, stamp) {
	console.log('%s says %s on %s on %s at %s', 
                from, message, conference, stamp.substr(0,9), stamp.substr(10));
});

Buddy

Event emitted when state of the buddy on your chat list changes

/**
	@param jid - is the id of buddy (eg:- [email protected])
	@param state - state of the buddy. value will be one of the following constant can be access 
                   via require('simple-xmpp').STATUS
		AWAY - Buddy goes away
		DND - Buddy set its status as "Do Not Disturb" or "Busy",
		ONLINE - Buddy comes online or available to chat
		OFFLINE - Buddy goes offline
	@param statusText - status message of the buddy (known as "custom message" in Gmail).
                        `null` if the buddy has not specified any status text.

	@param resource - is the last parameter of JID, which tells that the user is logged in via with device. 
                      (e.g mobile , Desktop )
*/
xmpp.on('buddy', function(jid, state, statusText, resource) {
	console.log('%s is in %s state - %s -%s', jid, state, statusText, resource);
});

Group Buddy

Event emitted when state of the buddy on group chat you recently joined changes

xmpp.on('groupbuddy', function(conference, from, state, statusText) {
	console.log('%s: %s is in %s state - %s',conference, from, state, statusText);
});

Buddy capabilities

Event emitted when a buddy's client capabilities are retrieved. Capabilities specify which additional features supported by the buddy's XMPP client (such as audio and video chat). See XEP-0115: Entity Capabilities for more information.

xmpp.on('buddyCapabilities', function(jid, data) {
	// data contains clientName and features
	console.log(data.features);
});

Stanza

access core stanza element when such received Fires for every incoming stanza

/**
	@param stanza - the core object
	xmpp.on('stanza', function(stanza) {
		console.log(stanza);
	});
*/

Methods

Send Chat Messages

/**
	@param to - Address to send (eg:- [email protected] - [email protected])
	@param message - message to be sent
	@param group - if true, send the message in a group chat
*/

xmpp.send(to, message, group);

Send Friend requests

/**
	@param to - Address to send (eg:- [email protected])
*/
xmpp.subscribe(to);

Accept Friend requests

/**
	@param from - Address to accept (eg:- [email protected])
*/
xmpp.acceptSubscription(from);

Unsubscribe Friend

/**
	@param to - Address to unsubscribe (eg:- [email protected])
*/
xmpp.unsubscribe(to);

Accept unsubscription requests

/**
	@param from - Address to accept (eg:- [email protected])
*/
xmpp.acceptUnsubscription(from);

Set presence

/**
	@param show - Your current presence state ['away', 'dnd', 'xa', 'chat']
	@param status - (optional) free text as your status message
*/
xmpp.setPresence('away', 'Out to lunch');

Set chatstate

/**
	@param to - The target JID (ie. person you are chatting with) to receive the chatstate
	@param state - Your current chatstate [ 'active', 'composing', 'paused', 'inactive', 'gone' ]
*/
xmpp.setChatstate('[email protected]', 'composing');

Get vCard

/*
	@param buddy - The JID to use
	@param callback - The function to call when the vCard is retreived. The returned data will be a JSON object
*/
xmpp.getVCard('[email protected]', function (vcard) {
	console.log('[email protected] vcard: ', vcard);
});

Probe the state of the buddy

/**
	@param jid - Buddy's id (eg:- [email protected])
	@param state -	State of the buddy.	 value will be one of the following constant can be access 
                    via require('simple-xmpp').STATUS
		AWAY - Buddy goes away
		DND - Buddy set its status as "Do Not Disturb" or	 "Busy",
		ONLINE - Buddy comes online or available to chat
		OFFLINE - Buddy goes offline
*/

xmpp.probe(jid, function(state) {

});

Disconnect session

/**
	no params
*/

xmpp.disconnect();

Fields

Fields provided Additional Core functionalies

xmpp.conn

The underlying connection object

var xmpp = simpleXMPP.connect({});
xmpp.conn; // the connection object

xmpp.Element

XMPP Element class (from node-xmpp)

var xmpp = simpleXMPP.connect({});
xmpp.Element; // the connection object

Guides

node-simple-xmpp's People

Contributors

arunoda avatar coffee-tech avatar cyberwolf avatar dandv avatar daniel15 avatar force-net avatar frosthaven avatar inkp avatar jackfranklin avatar jmar777 avatar julienbreux avatar jwoertink avatar le-yak avatar milk avatar myguidingstar avatar nilclass avatar pathsny avatar rakeshpai avatar rensreinders avatar rlange-drakontas avatar silverbucket avatar soggie avatar sonnyp avatar vittee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-simple-xmpp's Issues

can't disconnect connection

once I create a client connection via new xmpp.SimpleXMPP() I can't disconnect it. and the socket stays open.

This is snippet from the code I added locally:
this.disconnect = function() {
$.ready(function() {
var stanza = new xmpp.Element('presence', { type: 'unavailable' });
stanza.c('status').t('Logged out');
conn.send(stanza);
conn.end();
});
};
but there should be a solution for the presence keep alive function that runs with the setInterval

query.attrs undefined - line 331

Hi @Daniel15 a pull request you submitted a while back is causing an error in the library. Could you patch this? Seems simple enough, but I'm not sure what it means if the query variable is unset as in this case, what would be the correct course of action.

simple-xmpp/lib/simple-xmpp.js:331
    node = query.attrs.node,
                ^
TypeError: Cannot read property 'attrs' of undefined

Dependencies for CentOS

Heyho,

do you know where i can find the dependencies for CentOS?

Can use Toast on my server to install things or compiling by myself :(

But where i find this dependencies?

Check for online status before sending text

Hello,
I am using node-simple.xmpp in an home automation environment (http://ccu.io/).
I want to send events as xmpp messges to my google talk account which works initially pretty fine. However after some hours the google talk server seems to close the connection. I have tried to implement a reconnect in the onClose() method but that does not work.

Question: Can I check the online status before I send a text message? How?
Thanks.

xmpp disconnect and dont reconnect even if the reconnect attribute is set to true

File name :
.\node_modules\simple-xmpp\node_modules\node-xmpp\node_modules\node-xmpp-client\node_modules\node-xmpp-core\lib\connection.js

method "onClose()" : "self.reconnect" and this.reconnect" are undefine.

dont know why.
I have fixed this issue on my local setup. by passing the reconnect variable and the connect method as an argument from node_modules\simple-xmpp\node_modules\node-xmpp\node_modules\node-xmpp-client\lib\session.js file.

Incorrect from field for chat started from within a chatroom

If I use a 3rd party client (Swift on Mac) to join a room - then click on a participant to start a direct chat with them - then the stanza.from arriving at the chatroom looks like

with the name of the room first and the sender second - and the stanza.type is chat.
The handler for the chat type only looks at the first part and so reports (in this case) - [email protected] (i.e. the room) as the sender...

Should it maybe also look at the second part and if the second part (after the slash) contains an @ then use that as the sender ?

I don't know enough of the semantics of the two parts to know if this would be a valid thing to do in all cases ? Any thoughts ? Happy to raise a PR if it makes sense.

can't see invitation

The bot is not able to see invitation from new friends. Is there anyone else having the same issue? I've tried to put the bot account in either gtalk or hangout mode. Neither works.

handling offline message

hi,
i have a question, how to handle offline message.
i want offline message is rejected by system

thank you

TLS / Secure connection

Feature Request;

TLS doesn't seems to be available now. Can you make it available? When I try to connect on 5223 (secure), it can't authenticate.

<error code="500" type="wait"><resource-constraint> in presence

I've created a simple XMPP bot that connects to XMPP and sits quietly watching for status changes. Sometimes, instead of correct presence information, I get this:

<presence from="[email protected]" to="[email protected]/0fcabd76270901f9" type="error" xmlns:stream="http://etherx.jabber.org/streams">
    <error code="500" type="wait">
        <resource-constraint xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
    </error>
</presence>

How do I solve this?

chat group issue with Cisco Jabber

Hi,

I test a chatbot integration on Cisco Jabber but I've an issue with the chat group (it works properly in 1:1).
My target is to provide a bot in group chat... but not sure about the configuration to set for that so thanks in advance for your help.

br
guillain

Unable to receive message from MUC without join first

Hey,

I've developed a chat client using this library. All users subscribe to MUCs. I need to make those users able to receive message from MUC without joining (xmpp.join('[email protected]/user1');) all the MUCs. How can I achieve that? Based on my testing, my chat client need to join all MUCs in order for the users to get message from MUC.

transfer file and not event 'stanza'

Hi, sorry for my english. I have not found a method to transfer files. And when Psi +-client for Linux sends files in the method xmpp.on ('stanza', ..... event occurs, and when it sends the Miranda - Client for Windows - not an event occurs. Why?

Cannot keep alive

After connected, it will automatically exit with code 0 after a little while (like 3 minutes)

How can I list of users present in a MUC?

I have written a XMPP bot that lives in our MUC chatroom. I am wondering if there is a way to detect who are currently in the XMPP chatroom with simple-xmpp.

Thanks!

Transfer files method

Hello, is it possible to implement SI File Transfer (XEP-0096) or Jingle (XEP-0166) so that via node js i can stream/send files between two users in XMPP? If not, is there any other alternatives out there?

Thank you!

Trace: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.

I was trying to setup a connection to my company's XMPP server and received this error message. From what I can tell, I've set things up properly so I'm not sure how to resolve this error.

System Details

  • Node Version: v4.1.2
  • OS: OSX El Capitan (v10.11.1)

Code Example

I had to hide the actual credentials and server since this is a private server.

// Generated by CoffeeScript 1.10.0
(function() {
  var xmpp;

  xmpp = require('simple-xmpp');

  xmpp.on('online', function(data) {
    console.log("Connected with JID: " + data.jid.user);
    return console.log("Yes, I'm connected!");
  });

  xmpp.on('error', function(err) {
    return console.error(err);
  });

  xmpp.connect({
    jid: "[My JID]",
    password: '[My Password]',
    host: '[My Host]',
    port: 5222
  });

}).call(this);

I ran this file with node --trace-deprecation lib/app/javascript/xmppClient.js and got the following output:

Trace: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
    at Object.exports._printDeprecationMessage (internal/util.js:27:13)
    at Object.deprecated [as createCredentials] (internal/util.js:51:22)
    at connect (/Users/zabresch/Documents/8x8/electron/sso/node_modules/tls-connect/starttls.js:231:50)
    at Connection.setSecure (/Users/zabresch/Documents/8x8/electron/sso/node_modules/node-xmpp-core/lib/Connection.js:321:21)
    at Connection.onStanza (/Users/zabresch/Documents/8x8/electron/sso/node_modules/node-xmpp-core/lib/Connection.js:368:14)
    at StreamParser.<anonymous> (/Users/zabresch/Documents/8x8/electron/sso/node_modules/node-xmpp-core/lib/Connection.js:226:14)
    at emitOne (events.js:77:13)
    at StreamParser.emit (events.js:169:7)
    at SaxLtx.<anonymous> (/Users/zabresch/Documents/8x8/electron/sso/node_modules/node-xmpp-core/lib/StreamParser.js:59:22)
    at emitOne (events.js:77:13)
XMPP authentication failure

Has anyone else had this issue? Does anyone have any suggestions on how to resolve it? From the looks of it, the error might be from node-xmpp-core but I saw no issues posted on that repository. Any help would be greatly appreciated! Thanks!

XMPP authentication failure

connection error after upgrade to Openfire 4.1.1
console:
(node:15232) DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
XMPP authentication failure

simple gtalk example fails

xmpp = require("simple-xmpp")
xmpp.connect {jid: , password: , host: "talk.google.com", port: 5222)

TypeError: Cannot read property 'attrs' of undefined
at Client. (/node_modules/simple-xmpp/lib/simple-xmpp.js:281:45)
at Client.EventEmitter.emit (events.js:95:17)
at Client.onRawStanza (/node_modules/simple-xmpp/node_modules/node-xmpp/lib/xmpp/client.js:159:14)

stream error

$ node examples/echo.js [email protected] ...
Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'
{ name: 'stream:error',
  parent: null,
  attrs: { 'xmlns:stream': 'http://etherx.jabber.org/streams' },
  children:
   [ { name: 'invalid-xml',
       parent: [Circular],
       attrs: [Object],
       children: [] } ] }

Any ideas?

Edit: Node v0.10.16 - OSX 10.8.4

Unproper Node.js events implementation

Hey,

I've noticed the standard events of Node.js aren't implemented properly, as you require specifically EventEmitter (class Events) and thus do not implement all the core functionalities of Node.js (such as listenerCount(), or once()). I'll probably try to find a workaround and submit a pull request if I achieve to get a stable build of your plugin.

Thanks

Facebook Chat, no works!

I'm testing the module, but when I try to connect to facebook chat.

var xmpp = require('simple-xmpp');

xmpp.on('online', function() {
    console.log('Yes, I\'m connected!');
});

xmpp.on('error', function(err) {
    console.error(err);
});

xmpp.connect({
    jid : "[email protected]",
    password : "the_password",
    host : "chat.facebook.com",
    port : 5222
});

The server responds

$ node app.js
XMPP authentication failure

And I do not understand the generated authentication. If there are many applications that have no api

problems with Roster

i´m creating a chat, well.. on the first session i retrieve all roster's account, second i close this session and open other session and i retrieve all roster's first account. i'm working with sockets.
simpleXMMP.connect({ jid: user, password: passs, host: HOST }) ;

io.sockets.on('connection', function(socket) { simpleXMMP.getRoster(); });

simpleXMMP.on('stanza', function(stanza) { if (stanza.id == 'roster_0') { //CONTACTS var rosters = []; stanza.children[0].children.forEach(function(element, index) { var roster = { jid: element.attrs.jid, name: element.attrs.name, subscription: element.attrs.subscription }; rosters.push(roster); }); io.sockets.on('connect', function(socket) { socket.emit('roster', rosters); }) } });

Send Message in group issue

hi
One to one
xmpp.send("user@localhost", "test message", false);

One to group
xmpp.send("[email protected]", "test message", true);

While sending message between two users it's working fine but while user send message to group it's not work.

getVcard not working

Method returns only my jid vcard data, not working with contacts that are connected through gateways (vk, mrim, etc). Sorry for bad english.

Using this:

xmpp.on('buddy', function(jid, state, statusText, resource) {
    xmpp.getVCard(jid, function (vcard) {
        console.log(vcard);
    });
});

Architecture for multi-client application

Hey, for an instant messaging application with multiple clients, should one create multiple instances of XMPP clients? What is the best way to deal with this use case?

Reconnect on Error?

I'm having a problem with a program I wrote not reconnecting in the event of a problem. The program handles other stuff as well as XMPP, so when the XMPP connection dies, the program itself stays alive. I'd like to prevent this scenario from occurring, so that XMPP reconnects on its own if there's a problem. Am I missing a line of code or anything to auto handle connection issues?

Code:

xmpp.on('online', function(data) {
console.log('Yes, I'm connected!');
console.log(xmpp.conn);
});

xmpp.on('error', function(err) {
console.error(err);
});

xmpp.connect({
jid : '[email protected]',
password : 'XXXXXXXX',
host : 'talk.google.com',
port : 5222
});

xmpp.subscribe('[email protected]');
xmpp.getRoster();


The last thing I saw before it died (from console.log(err)):

{ name: 'stream:error',
parent: null,
attrs: { 'xmlns:stream': 'http://etherx.jabber.org/streams' },
children:
[ { name: 'see-other-host',
parent: [Circular],
attrs: [Object],
children: [] },
{ name: 'str:text',
parent: [Circular],
attrs: [Object],
children: [Object] } ] }

maintain roster if requested

Hi,
I'm not sure what the appropriate place to put this is so I thought I'd make an issue. In my local application I maintain, once connected, the roster of all the buddies and the presence of each resource that is broadcast. Now this results in additional state. If you think this might actually make sense in the library, I could push it back in here and give you a pull request. However, if the feeling is that this does not belong in this library, then I can avoid doing the work :)

Make capability queries optional

Right now whenever you connect and receive a bunch of stanzas, that triggers a disco#info query for each that carries a caps node (). There is no way to deactivate that behavior.
I think there should be two things:

  1. An option for "connect" to deactivate capability checks
  2. A method to explicitly query capabilities for a given buddy.

The way it is implemented now, there is also no way to cache the 's "ver" attribute, which would allow re-querying capabilities only when they have changed.

@Daniel15, cc @silverbucket

xml-not-well-formed error when sending a message

When I try to send a message, it causes me to log out and then throws an error:
screen shot 2014-10-02 at 11 27 00 am

class User
    constructor: ->
        @xmpp = require('simple-xmpp')
        #.... other stuff
    connect: ->
        @xmpp.connect
            jid: "#{@extension}@#{@server}"
            password: @settings.password
            host: @server
            port: 5222
        @xmpp.on 'error', (err)->
           console.error('XMPP ERROR', err)
        @xmpp.on 'close', ->
           console.log('connection has been closed!')
    sendMessage: (user, message)->
        target = "#{user}@#{@server}"
        @xmpp.send(target, message)

I sign in, and can set presence just fine. It's only when I try to send a message when it logs me out and throws that error. Using version 0.1.92

messages repeated in group chat

I am writing a curl script that calls express/node.js url to send a message to a group chat room. All my logic to send message to group chat is in online callback.

xmpp.on('online', function() {
chat_room = req.body.chat_room + '@conference.chat.domain.com';
xmpp.join(chat_room+'/batman');
xmpp.send(chat_room, req.body.content, true);
});

When I call the curl script twice, I see three messages being posted (second call also posts the message from first call) to group chat room. Is there a clean way to close connection or leave chat room after sending each message to group chat room?

Project Maintainance

I've switched the project ownership from myself to organization simple-xmpp.
This allows several others to actively maintain the project since I'm too busy with the project.

@silverbucket will be joining the team with me.
I keep the ownership of npm repository myself for now. If we need it we can change it. But I really don't know how.

Thanks @silverbucket and hope this project could help others interested too.

P.S. If some one interested in joining the team, just drop a message here.

GetPresence

Is there any way using your code to search all people who has a specific presence.
For example the list of people who has the status "eating"
Thank you

cannot install to windows box

i have been tried to install to windows box and getting the following error message.

C:\Program Files\nodejs>npm install simple-xmpp
npm http GET https://registry.npmjs.org/simple-xmpp
npm http 200 https://registry.npmjs.org/simple-xmpp
npm http GET https://registry.npmjs.org/simple-xmpp/-/simple-xmpp-0.1.5beta.tgz
npm http GET https://registry.npmjs.org/node-xmpp
npm http GET https://registry.npmjs.org/node-stringprep
npm http GET https://registry.npmjs.org/qbox/0.1.3
npm http 200 https://registry.npmjs.org/qbox/0.1.3
npm http GET https://registry.npmjs.org/qbox/-/qbox-0.1.3.tgz
npm http 200 https://registry.npmjs.org/node-stringprep
npm http GET https://registry.npmjs.org/node-stringprep/-/node-stringprep-0.1.4.
tgz
npm http 200 https://registry.npmjs.org/node-xmpp
npm http GET https://registry.npmjs.org/node-xmpp/-/node-xmpp-0.3.2.tgz

[email protected] install C:\Program Files\nodejs\node_modules\simple-xmpp
\node_modules\node-stringprep
sh ./install.sh

'sh' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! EEXIST, mkdir 'C:\Program Files\nodejs\node_modules\simple-xmpp\node_mo
dules\node-xmpp\lib\xmpp'
File exists: C:\Program Files\nodejs\node_modules\simple-xmpp\node_modules\node-
xmpp\lib\xmpp
Move it away, and try again.

npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "simple-xmpp"
npm ERR! cwd C:\Program Files\nodejs
npm ERR! node -v v0.8.0
npm ERR! npm -v 1.1.32
npm ERR! path C:\Program Files\nodejs\node_modules\simple-xmpp\node_modules\node
-xmpp\lib\xmpp
npm ERR! fstream_path C:\Program Files\nodejs\node_modules\simple-xmpp\node_modu
les\node-xmpp\lib\xmpp\component.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! message EEXIST, mkdir 'C:\Program Files\nodejs\node_modules\simple-xmpp
\node_modules\node-xmpp\lib\xmpp'
npm ERR! errno 47
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fst
ream\lib\writer.js:171:23
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\mkd
irp\index.js:45:53
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR! 47 errno
npm ERR! [email protected] install: sh ./install.sh
npm ERR! cmd "/c" "sh ./install.sh" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-stringprep package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! sh ./install.sh
npm ERR! You can get their info via:
npm ERR! npm owner ls node-stringprep
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "simple-xmpp"
npm ERR! cwd C:\Program Files\nodejs
npm ERR! node -v v0.8.0
npm ERR! npm -v 1.1.32
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: sh ./install.sh
npm ERR! message cmd "/c" "sh ./install.sh" failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Program Files\nodejs\npm-debug.log
npm ERR! not ok code 0

C:\Program Files\nodejs>

Disable MUC history on join

Hey,

I'd like to be able to disable history on join of a room

this.join = function(to) {

    $.ready(function() {
        var stanza =  new xmpp.Element('presence', { to: to }).
        c('x', { xmlns: 'http://jabber.org/protocol/muc' }).
        c('history', { maxstanzas: 0, seconds: 1});
        conn.send(stanza);
    });
};

Perhaps make it configurable?
Cheers.

How to send styled messages?

I'm trying things like

'<html xmlns="http://www.w3.org/1999/xhtml"><body>'+res+'</body></html>' 

but I just get the html in a chat room. How to send formatted messages?

Method to set state/statusText

Right now it doesn't seem like there's a way to set the logged in users state or statusText...

something like:

xmpp.setState(state, statusText);

Create Tags v0.1.15 - v0.1.19

Could you please create the Tags v0.1.15 - v0.1.19?

A npm install node-simple-xmpp installs v0.1.14 cause of missing Tags.

'error' event is not emitted when a socket error occurs

Is this by design? I noticed that socket 'error' events simply call Connection.onEnd(), which quietly exits. I had a case where the socket couldn't connect to the host at all, and my process was quietly finishing looking like everything's fine.

As a work-around, I ended up listening to socket errors directly:

this.xmpp_connection.conn.socket.on 'error',(function(error){
  throw error
}

Presence error marks buddy as online

Related to #15 - If a presence stanza like the following is received:

<presence from="[email protected]" to="[email protected]/0fcabd76270901f9" type="error" xmlns:stream="http://etherx.jabber.org/streams">
    <error code="500" type="wait">
        <resource-constraint xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
    </error>
</presence>

A buddy event is fired but the status is incorrectly set to online.

error in browserify to bundle the simple-xmp

browerify the following file always reports Error: Cannot find module './lib/node-xmpp-browserify'. Any idea or suggestion. Thanks

index.js:

(function() {
  var xmpp;

  xmpp = require('simple-xmpp');

  xmpp.on('online', function() {
    return console.log('online');
  });

  xmpp.connect({
    jid: 'abc.com',
    password: '',
    boshURL: 'http://abc.com:5280/http-bind'
  });

}).call(this);

Status of project??

Hello, just wondering what the status of this project is. There are a few pull requests and bugs filed and no response for over a month so far. Perhaps it would be a good idea to add a few maintainers to the project to keep things running smoothly and avoid a major fork?

Maybe setting up an ORG and assigning co-maintainers would be cool

just some thoughts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.