Skip to content
This repository was archived by the owner on Nov 19, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/simple-xmpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
var xmpp = require('node-xmpp-client');
var Stanza = xmpp.Stanza; // http://node-xmpp.org/doc/ltx.html
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var qbox = require('qbox');

var STATUS = {
Expand Down Expand Up @@ -331,9 +330,7 @@ function SimpleXMPP() {
var body = stanza.getChild('body');
if(body) {
var message = body.getText();
var from = stanza.attrs.from;
var id = from.split('/')[0];
events.emit('chat', id, message);
events.emit('chat', stanza.attrs.from, message);
}

var chatstate = stanza.getChildByAttr('xmlns', NS_CHATSTATES);
Expand Down
1 change: 0 additions & 1 deletion node-simple-xmpp
Submodule node-simple-xmpp deleted from 8478aa
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ xmpp.on('close', function() {
```

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

```javascript
xmpp.on('chat', function(from, message) {
Expand Down