GithubHelp home page GithubHelp logo

hubot-xmpp's Introduction

Hubot XMPP

Connects Hubot to your XMPP network

Build Status

Setup

Install dependencies with npm

npm install

Configuration

There are a few configuration values you can use when getting hubot-xmpp running. The XMPP adapter requires only 3 (5 if you need specify server and port) environment variables to be set to able to use it.

  • HUBOT_XMPP_USERNAME
  • HUBOT_XMPP_PASSWORD
  • HUBOT_XMPP_ROOMS

Optional:

  • HUBOT_XMPP_HOST The host name you want to connect to if its different than what is in the username jid.
  • HUBOT_XMPP_PORT The port to connect to on the jabber server.
  • HUBOT_XMPP_LEGACYSSL Set to 1 to enable legacy SSL port. This requires the host to be defined.
  • HUBOT_XMPP_PREFERRED_SASL_MECHANISM Used to change the encoding used for SASL.
  • HUBOT_XMPP_DISALLOW_TLS Prevent upgrading the connection to a secure one via TLS.
  • HUBOT_XMPP_PM_ADD_PREFIX Make commands work in PMs to hubot without robot name/alias.
  • HUBOT_XMPP_KEEPALIVE_INTERVAL Keep-alive interval in ms.
  • HUBOT_XMPP_RECONNECT_TRY the number of reconnect retry in case of disconnection, default is 5.
  • HUBOT_XMPP_RECONNECT_WAIT the time in ms to wait before reconnecting, default is 5000.

HUBOT_XMPP_ROOMS can be a comma separated list of rooms to join. If your rooms require passwords you should use the jid:password syntax. Room passwords cannot contain ,. Room names must be the full jid of the room for example [email protected].

HUBOT_XMPP_PM_ADD_PREFIX works by prefixing the private message with hubot name, so a side effect is that the bot ignores commands of type /^command/i.

Installation

Create a standalone hubot with xmpp adapter:

mkdir -p ./my-bot
cd ./my-bot
npx -p yo -p generator-hubot -c 'yo hubot --adapter=xmpp'

See also https://hubot.github.com/docs/ .

Group chat vs private JID

The jabber protocol does not broadcast real user JID in groupchat presence stanzas unless the server/chat room is configured to do so.

If you need to send private chat in response to a groupchat message, use hubot's send method with the groupchat jid and envelope.user.type = 'direct'. hubot-xmpp will then automatically resolve the JID to a private chat JID, and private message the sender.

If you need to get the private chat JID, you can use msg.envelope.user.privateChatJid where msg is the parameter of hubot's route callback.

Example:

robot.respond(/talk to me$/i, msg => {
  // Simply reply
  msg.reply(`Hello ${msg.envelope.user.name}. Your private JID is ${msg.envelope.user.privateChatJID}`);
});

robot.respond(/talk to me in private$/i, msg => {
  msg.envelope.user.type = 'direct';
  msg.send(`Hey ${msg.envelope.user.name}! You told me in room ${msg.envelope.user.room} to talk to you.`);
});

hubot-xmpp's People

Contributors

ajacksified avatar andyfowler avatar anupdhml avatar aw avatar bolasblack avatar cashwilliams avatar dominicrj23 avatar dpilone avatar dynajoe avatar ejfinneran avatar gbonnefille avatar gregkare avatar ivey avatar jonfreedman avatar kkreamer avatar larsfronius avatar markstory avatar mbbx6spp avatar mdarveau avatar mgriffin avatar nevon avatar omega avatar pangratz avatar pixelrebel avatar raucao avatar scboucher avatar sonnyp avatar strugee avatar zarkzork 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  avatar  avatar  avatar

hubot-xmpp's Issues

Cannot find module 'hubot' with hubot 2.0.7

I got Cannot find module 'hubot' while doing (with hubot 2.0.7) :

git clone https://github.com/github/hubot.git
cd hubot
I Added "hubot-xmpp": ">= 0.0.4" to package.json
npm install
sudo npm install -g coffee-script
make test

$ bin/hubot -a xmpp
[Tue, 20 Dec 2011 15:45:58 GMT] INFO Loading adapter xmpp
[Tue, 20 Dec 2011 15:45:58 GMT] ERROR Cannot load adapter xmpp - Error: Cannot find module 'hubot'
[Tue, 20 Dec 2011 15:45:58 GMT] INFO Loading scripts from /home/bbigras/hubot/scripts
[Tue, 20 Dec 2011 15:45:58 GMT] INFO Loading scripts from /home/bbigras/hubot/src/scripts
TypeError: Cannot call method 'run' of null
at Robot.run (/home/bbigras/hubot/src/robot.coffee:238:27)
at Object. (/home/bbigras/hubot/bin/hubot:105:11)
at Object. (/home/bbigras/hubot/bin/hubot:108:4)
at Module._compile (module.js:432:26)
at Object.run (/usr/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:68:25)
at /usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:135:29
at /usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:110:18
at [object Object]. (fs.js:114:5)
at [object Object].emit (events.js:64:17)
at afterRead (fs.js:1081:12)

Hubot sending multiple messages in private chat

I'm currently using hubot-xmpp to use Hubot with Slack, primarily because I want to run Hubot behind our company firewall, and the hubot-slack adapter requires that Hubot be publicly accessible.

Hubot was working just fine, but this evening he for some reason started sending three responses to me in private chat. He doesn't do this in group chat rooms, though, it seems to be just in private chat.

I dunno why this might have started happening, and I'm not really sure where to start investigating. Any ideas?

simple script crashes?

I switched from hubot-hipchat to hubot-xmpp in the hopes that this bug I am running into would not exist here, but it appears you are running the same old version of node-xmpp so I am having the same problem.

Do you know why this simple script would crash?

# Description                                                                                                                         
#   get eye process monitoring info                                                                                                   
#                                                                                                                                     
#   Commands                                                                                                                          
#     hubot eye - executes sudo eye i on the server and returns the result                                                            
#                                                                                                                                     
#                                                                                                                                     

module.exports = (robot) ->                                                                                                           
  robot.respond /(eye)/i, (msg) ->                                                                                                    
    sys = require('sys')                                                                                                              
    @exec = require('child_process').exec                                                                                             
    command = "sudo eye i"                                                                                                            
    @exec command, (error, stdout, stderr) ->                                                                                         
      msg.send stdout

Crashes with this error originating from node-xmpp:

[Mon Aug 19 2013 10:38:06 GMT-0700 (PDT)] DEBUG  OUT > <message to="[email protected]" type="chat" from="[email protected]/hubot-hipchat"><inactive xmlns="http://jabber/protocol/chatstates"/><body>mybot               
  hubot ........................... up
resque                     
  worker ................... up  (Aug16, 0%, 88Mb, &lt;15913&gt;)

</body></message>

/var/www/mybot/releases/20130819053939/node_modules/hubot-hipchat/node_modules/node-xmpp/lib/xmpp/connection.js:277
    this.socket.end();
                ^
TypeError: Cannot call method 'end' of undefined
  at Client.Connection.onEnd (/var/www/mybot/releases/20130819053939/node_modules/hubot-hipchat/node_modules/node-xmpp/lib/xmpp/connection.js:277:17)
  at CleartextStream.<anonymous> (/var/www/mybot/releases/20130819053939/node_modules/hubot-hipchat/node_modules/node-xmpp/lib/xmpp/connection.js:56:14)
  at CleartextStream.EventEmitter.emit (events.js:117:20)
  at _stream_readable.js:910:16
  at process._tickCallback (node.js:415:13)

I've written several other scripts that do pretty much the same thing, execute a command on the server and return the result, I have no idea why this one is a problem for node-xmpp. For example this script works fine:

# Description
#   show free memory
#
#   Commands
#     hubot free - executes free on the server
#
module.exports = (robot) ->
  robot.respond /(free)/i, (msg) ->
    sys = require('sys')
    @exec = require('child_process').exec
    command = "free"
    @exec command, (error, stdout, stderr) ->
      msg.send stdout

Hubot signs off when messaging offline user

I've recently tried to get hubot+xmpp set up at work, and I am running into an issue where when hubot attempts to privately message a user who is offline, he goes offline. When I look at the logs, this is what is there after the event of receiving the command to message a private user:

[Fri Feb 21 2014 15:44:12 GMT-0800 (PST)] DEBUG Received offline event
[Fri Feb 21 2014 15:44:12 GMT-0800 (PST)] DEBUG Received offline event

and that is it. Hubot signs out of our internal chat service, but it looks like his process continues to run. I am using the most recent version of hubot and xmpp, and the only changes I have made are to the xmpp.coffee script. I changed all of the lines referencing chatroom names ("#{room.jid}@our-internal-chat.com/#{@robot.name}") so he could actually get into our chatrooms. Here is the code I am using to test privately messaging the offline user:

robot.respond /message/i, (msg) ->
msg.envelope.user.type = 'direct'
msg.envelope.user.privateChatJID = "[email protected]"
msg.send "Testing offline messages"

Hubot can attempt to privately message users who don't exist, and works fine. Anyways, is this something anyone else has experienced? Is there something wrong with changing the chatroom references in xmpp.coffee? Do I need to change it elsewhere? Is there something wrong with the method I am using to privately message users? Do I need to provide more information in order for someone to help me?

Thank you!

Error with user related functionality

I get this error when issuing commands like 'user is' and anything related to interacting with users:

[Tue Feb 12 2013 14:39:24 GMT-0800 (PST)] ERROR Unable to call the listener: TypeError: Object # has no method 'usersForFuzzyName'
TypeError: Object # has no method 'usersForFuzzyName'
at TextListener.callback (/home/matt/hubot/scripts/roles.coffee:27:23)
at TextListener.Listener.call (/home/matt/hubot/node_modules/hubot/src/listener.coffee:19:14)
at Robot.receive (/home/matt/hubot/node_modules/hubot/src/robot.coffee:102:33)
at XmppBot.Adapter.receive (/home/matt/hubot/node_modules/hubot/src/adapter.coffee:37:25)
at XmppBot.readMessage (/home/matt/hubot/node_modules/hubot-xmpp/src/xmpp.coffee:176:19)
at XmppBot.__bind as readMessage
at XmppBot.read (/home/matt/hubot/node_modules/hubot-xmpp/src/xmpp.coffee:135:23)
at Client.__bind (/home/matt/hubot/node_modules/hubot-xmpp/src/xmpp.coffee:3:61)
at Client.EventEmitter.emit (events.js:96:17)
at Client.onRawStanza (/home/matt/hubot/node_modules/hubot-xmpp/node_modules/node-xmpp/lib/xmpp/client.js:159:14)

There's a similar closed issue in hubot itself:
github/hubot-scripts#729

The answer from tombell:
"The gtalk adapter needs updating because the usersForFuzzyName is now on robot.brain not robot"

Please release new version

Hello,

I'd like to test out the newest version of this and would really appreciate if you could publish the 0.1.12 version to the npm registry. Thanks!

going offline after some time

Hi,

the bot just going offline after some time of idle and i dont know how to fix that:

[Sat Feb 22 2014 13:41:31 GMT+0100 (CET)] DEBUG [received iq]  iq type="get" id="111-111111" from="robertsspaceindustries.com" to="[email protected]/7fbb6dc0" xmlns:stream="http://etherx.jabber.org/streams"><ping xmlns="urn:xmpp:ping"/ /iq


 [Sat Feb 22 2014 13:41:31 GMT+0100 (CET)] DEBUG [sending pong] iq to="robertsspaceindustries.com" from="[email protected]/7fbb6dc0" type="result" id="111-111111"/


 [Sat Feb 22 2014 13:46:34 GMT+0100 (CET)] DEBUG Received offline event
 [Sat Feb 22 2014 13:46:34 GMT+0100 (CET)] DEBUG Received offline event

sometimes it takes 30min sometime over 2 hours then he´s going offline

Latest npm release is 0.1.12

The npmjs.com repository does not offer any build after 0.1.12. I am wondering if you are aware of the situation since 0.1.15 was release yesterday and unavailable from npm.

Best way to do direct messages over XMPP?

I'm trying to determine what the best method for sending direct messages from Hubot to other XMPP users would be. Currently, I have this:

    robot.router.post '/notifications/direct-im', (req, res) ->
            body = req.body

        message = body.message
        username = body.username

        user = robot.brain.userForName username
        user.id = username
        user.type = 'direct'

        robot.send user, "#{message}"

        res.writeHead 200, {'Content-Type': 'text/plain'}
        res.end "OK"

However, that code doesn't seem to send the message to the user. What am I doing wrong?

Username sent to xmpp server as undefined

Hi,

I've defined the EV as told in README files. I can see the correct username in the inspect/log when I run hubot. But the xmpp server log shows the username being sent as undefined. Please tell me where I could've gone wrong. I'm using the clone of hubot-xmpp and 2.1.4 of hubot download from the site.

Problem with bot status

Hello, I'm facing some problems when I'm trying to use the adapter.

I was able to connect it to the jabber server and the bot responds to all the requests without no problem. The only problem is that the status of the bot appears as offline.

There is any option to change that?

Best Regards

hubot doesn't respond

I just installed hubot and hubot-xmpp last night. Hubot works with the shell adapter, and after specifying the SASL mechanism as plain, I was able to get hubot-xmpp connecting to our server and showing up in the specified rooms. However, the robot does not respond to anything via xmpp.

I know that the xmpp module is seeing the messages, but they are not being handed off to the main hubot code, apparently.

Since this issue seems very much like issue #1, I tried deleting the hubot/node_modules/hubot-xmpp/node_modules/hubot directory as was mentioned in one of the comments as a fix. However if I do that, hubot fails to start with the following error:

Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'
[Thu Jan 03 2013 01:17:41 GMT-0800 (PST)] ERROR Cannot load adapter xmpp - TypeError: Cannot read property 'prototype' of undefined
TypeError: Cannot call method 'on' of null
at Object. (/usr/local/lib/hubot/node_modules/hubot/bin/hubot:105:19)
at Object. (/usr/local/lib/hubot/node_modules/hubot/bin/hubot:109:4)
at Module._compile (module.js:441:26)
at Object.run (/usr/local/lib/hubot/node_modules/hubot/node_modules/coffee-script/lib/coffee-script/coffee-script.js:79:25)

SSL Issue

We are trying to connect Hubot to our internal jabber server but are getting the following error

events.js:48
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: 139977127081760:error:1411809D:SSL routines:SSL_CHECK_SERVERHELLO_TLSEXT:tls invalid ecpointformat list:t1_lib.c:1473:
139977127081760:error:14092113:SSL routines:SSL3_GET_SERVER_HELLO:serverhello tlsext:s3_clnt.c:946:

    at CleartextStream._pusher (tls.js:508:24)
    at CleartextStream._push (tls.js:334:25)
    at SecurePair.cycle (tls.js:734:20)
    at EncryptedStream.write (tls.js:130:13)
    at Socket.ondata (stream.js:38:26)
    at Socket.emit (events.js:67:17)
    at TCP.onread (net.js:347:14)

We suspect this is likely something to do with the OpenSSL libs on the server we are trying to get Hubot to run on. However we have hit a wall trying to figure it out and are reaching out for some help

Cannot install on 2008 x64

I keep receiving an error about one of the dependencies.

PS C:\Windows\system32> cd C:\scripts\Node\hubot\node_modules\hubot
PS C:\scripts\Node\hubot\node_modules\hubot> npm install
npm http GET https://registry.npmjs.org/hubot-xmpp
npm http 304 https://registry.npmjs.org/hubot-xmpp
npm http GET https://registry.npmjs.org/node-xmpp/0.3.2
npm http GET https://registry.npmjs.org/node-expat/1.6.1
npm http 304 https://registry.npmjs.org/node-xmpp/0.3.2
npm http 304 https://registry.npmjs.org/node-expat/1.6.1
npm http GET https://registry.npmjs.org/ltx

> [email protected] install C:\scripts\Node\hubot\node_modules\hubot\node_modules\hubot-xmpp\node_modules\node-expat
> node-gyp rebuild


C:\scripts\Node\hubot\node_modules\hubot\node_modules\hubot-xmpp\node_modules\node-expat>node "C:\Program Files\nodejs\n
ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
npm http 304 https://registry.npmjs.org/ltx
C:\scripts\Node\hubot\node_modules\hubot\node_modules\hubot-xmpp\node_modules\node-expat\build\node_expat.vcxproj(18,3)
: error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Imp
ort> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:2
36:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuil
d"
gyp ERR! cwd C:\scripts\Node\hubot\node_modules\hubot\node_modules\hubot-xmpp\node_modules\node-expat
gyp ERR! node -v v0.8.14
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
npm http GET https://registry.npmjs.org/sax
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` 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-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-expat
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\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
 "install"
npm ERR! cwd C:\scripts\Node\hubot\node_modules\hubot
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! code ELIFECYCLE
npm http 304 https://registry.npmjs.org/sax
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\scripts\Node\hubot\node_modules\hubot\npm-debug.log
npm ERR! not ok code 0

adapter format has changed

hubot >2.4.1 sends an envelope instead of a user for send and reply.

I'll work up a PR in the next day or so if nobody beats me to it.

Getting problems with Hubot and Openfire

Hi I installed Openfire and hubot, and both of them are working. Hubot is working in CLI mode. And Openfire is working, i connect with a LDAP and i created a user for hubot, and everything is correct until there.

I follow this http://www.lordofthejars.com/2012/10/installing-and-running-hubot-terminator.html

Enviroments config:

export HUBOT_XMPP_USERNAME='hubot'
export HUBOT_XMPP_PASSWORD='password'
export HUBOT_XMPP_ROOMS='[email protected]'
export HUBOT_XMPP_HOST='http://localhost'
export HUBOT_XMPP_PORT='5222'
export HUBOT_XMPP_LEGACYSSL='0'

Command executed in Terminal

./bin/hubot --name hubot--adapter xmpp

This is the error what i got after executing:

Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'
[Fri Mar 07 2014 06:02:15 GMT-0500 (EST)] INFO { username: 'hubot',
  password: '********',
  host: 'http://localhost',
  port: '5222',
  rooms: [ { jid: '[email protected]', password: false } ],
  keepaliveInterval: 30000,
  legacySSL: '0',
  preferredSaslMechanism: undefined,
  disallowTLS: undefined }

... And nothing happends after this...

My nodeJs version (Using nvm) is

v0.10.26

My "npm ls" is


[email protected] /opt/hubot
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
  └─┬ [email protected]
    ├── [email protected]
    ├── [email protected]
    ├─┬ [email protected]
    │ ├─┬ [email protected]
    │ │ ├─┬ [email protected]
    │ │ │ └── [email protected]
    │ │ ├── [email protected]
    │ │ ├── [email protected]
    │ │ ├── [email protected]
    │ │ ├─┬ [email protected]
    │ │ │ └── [email protected]
    │ │ ├── [email protected]
    │ │ ├── [email protected]
    │ │ ├─┬ [email protected]
    │ │ │ └── [email protected]
    │ │ └─┬ [email protected]
    │ │   └─┬ [email protected]
    │ │     ├── [email protected]
    │ │     ├── [email protected]
    │ │     └── [email protected]
    │ ├─┬ [email protected]
    │ │ └─┬ [email protected]
    │ │   ├── [email protected]
    │ │   ├── [email protected]
    │ │   └─┬ [email protected]
    │ │     └── [email protected]
    │ ├─┬ [email protected]
    │ │ └── [email protected]
    │ ├─┬ [email protected]
    │ │ └─┬ [email protected]
    │ │   ├── [email protected]
    │ │   └── [email protected]
    │ ├─┬ [email protected]
    │ │ └── [email protected]
    │ ├── [email protected]
    │ ├── [email protected]
    │ ├─┬ [email protected]
    │ │ ├── [email protected]
    │ │ ├── [email protected]
    │ │ ├─┬ [email protected]
    │ │ │ └── [email protected]
    │ │ ├─┬ [email protected]
    │ │ │ └─┬ [email protected]
    │ │ │   └── [email protected]
    │ │ ├── [email protected]
    │ │ └── [email protected]
    │ ├─┬ [email protected]
    │ │ ├── [email protected]
    │ │ └── [email protected]
    │ ├─┬ [email protected]
    │ │ ├─┬ [email protected]
    │ │ │ ├─┬ [email protected]
    │ │ │ │ └─┬ [email protected]
    │ │ │ │   └── [email protected]
    │ │ │ └── [email protected]
    │ │ ├── [email protected]
    │ │ └── [email protected]
    │ ├─┬ [email protected]
    │ │ └── [email protected]
    │ ├── [email protected]
    │ ├── [email protected]
    │ ├── [email protected]
    │ ├─┬ [email protected]
    │ │ └── [email protected]
    │ ├── [email protected]
    │ └─┬ [email protected]
    │   ├─┬ [email protected]
    │   │ ├── [email protected]
    │   │ └── [email protected]
    │   ├── [email protected]
    │   └─┬ [email protected]
    │     ├─┬ [email protected]
    │     │ └── [email protected]
    │     └─┬ [email protected]
    │       └── [email protected]
    ├─┬ [email protected]
    │ └── [email protected]
    ├─┬ [email protected]
    │ └── [email protected]
    ├─┬ [email protected]
    │ └── [email protected]
    └─┬ [email protected]
      ├── [email protected]
      ├── [email protected]
      ├─┬ [email protected]
      │ ├── [email protected]
      │ └─┬ [email protected]
      │   └── [email protected]
      ├─┬ [email protected]
      │ ├── [email protected]
      │ ├── [email protected]
      │ ├── [email protected]
      │ └── [email protected]
      ├─┬ [email protected]
      │ ├── [email protected]
      │ ├── [email protected]
      │ └── [email protected]
      ├── [email protected]
      ├── [email protected]
      ├── [email protected]
      ├── [email protected]
      ├── [email protected]
      ├─┬ [email protected]
      │ └── [email protected]
      └── [email protected]

And... when i am installing hubot with "npm install", i get these errors:

npm http GET http://registry.npmjs.org/hubot-xmpp
npm http 304 http://registry.npmjs.org/hubot-xmpp
npm http GET http://registry.npmjs.org/node-xmpp/0.10.0
npm http 304 http://registry.npmjs.org/node-xmpp/0.10.0
npm http GET http://registry.npmjs.org/node-expat
npm http GET http://registry.npmjs.org/ltx
npm http GET http://registry.npmjs.org/request
npm http GET http://registry.npmjs.org/browser-request
npm http GET http://registry.npmjs.org/faye-websocket
npm http GET http://registry.npmjs.org/blueimp-md5
npm http GET http://registry.npmjs.org/browserify
npm http 304 http://registry.npmjs.org/node-expat
npm http 304 http://registry.npmjs.org/browser-request
npm http 304 http://registry.npmjs.org/ltx
npm http 304 http://registry.npmjs.org/request
npm http 304 http://registry.npmjs.org/faye-websocket
npm http 304 http://registry.npmjs.org/browserify
npm http 304 http://registry.npmjs.org/blueimp-md5
npm http GET http://registry.npmjs.org/websocket-driver
npm http GET http://registry.npmjs.org/qs
npm http GET http://registry.npmjs.org/json-stringify-safe
npm http GET http://registry.npmjs.org/node-uuid
npm http GET http://registry.npmjs.org/forever-agent
npm http GET http://registry.npmjs.org/mime
npm http GET http://registry.npmjs.org/tough-cookie
npm http GET http://registry.npmjs.org/form-data
npm http GET http://registry.npmjs.org/tunnel-agent
npm http GET http://registry.npmjs.org/http-signature
npm http GET http://registry.npmjs.org/oauth-sign
npm http GET http://registry.npmjs.org/hawk
npm http GET http://registry.npmjs.org/aws-sign2
npm http GET http://registry.npmjs.org/sax
npm http 304 http://registry.npmjs.org/websocket-driver
npm http 304 http://registry.npmjs.org/json-stringify-safe
npm http 304 http://registry.npmjs.org/forever-agent
npm http 304 http://registry.npmjs.org/node-uuid
npm http 304 http://registry.npmjs.org/qs
npm http 304 http://registry.npmjs.org/mime
npm http 304 http://registry.npmjs.org/tough-cookie
npm http 304 http://registry.npmjs.org/form-data
npm http 304 http://registry.npmjs.org/tunnel-agent
npm http 304 http://registry.npmjs.org/http-signature
npm http 304 http://registry.npmjs.org/hawk
npm http 304 http://registry.npmjs.org/aws-sign2
npm http 304 http://registry.npmjs.org/sax
npm http 304 http://registry.npmjs.org/oauth-sign
npm http GET http://registry.npmjs.org/combined-stream
npm http GET http://registry.npmjs.org/async
npm http 304 http://registry.npmjs.org/async
npm http 304 http://registry.npmjs.org/combined-stream
npm http GET http://registry.npmjs.org/assert-plus/0.1.2
npm http GET http://registry.npmjs.org/asn1/0.1.11
npm http GET http://registry.npmjs.org/ctype/0.5.2
npm http 304 http://registry.npmjs.org/assert-plus/0.1.2
npm http 304 http://registry.npmjs.org/asn1/0.1.11
npm http 304 http://registry.npmjs.org/ctype/0.5.2
npm http GET http://registry.npmjs.org/delayed-stream/0.0.5
npm http GET http://registry.npmjs.org/punycode
npm http 304 http://registry.npmjs.org/delayed-stream/0.0.5
npm http GET http://registry.npmjs.org/hoek
npm http GET http://registry.npmjs.org/boom
npm http GET http://registry.npmjs.org/sntp
npm http GET http://registry.npmjs.org/cryptiles
npm http 304 http://registry.npmjs.org/boom
npm http 304 http://registry.npmjs.org/hoek
npm http 304 http://registry.npmjs.org/cryptiles
npm http 304 http://registry.npmjs.org/sntp
npm http 304 http://registry.npmjs.org/punycode
npm http GET http://registry.npmjs.org/deps-sort
npm http GET http://registry.npmjs.org/shell-quote
npm http GET http://registry.npmjs.org/through
npm http GET http://registry.npmjs.org/duplexer
npm http GET http://registry.npmjs.org/stream-combiner
npm http GET http://registry.npmjs.org/concat-stream
npm http GET http://registry.npmjs.org/insert-module-globals
npm http GET http://registry.npmjs.org/syntax-error
npm http GET http://registry.npmjs.org/browser-resolve
npm http GET http://registry.npmjs.org/browser-builtins/2.0.4
npm http GET http://registry.npmjs.org/inherits
npm http GET http://registry.npmjs.org/optimist
npm http GET http://registry.npmjs.org/JSONStream
npm http GET http://registry.npmjs.org/umd
npm http GET http://registry.npmjs.org/parents
npm http GET http://registry.npmjs.org/module-deps
npm http GET http://registry.npmjs.org/browser-pack
npm http 304 http://registry.npmjs.org/shell-quote
npm http 304 http://registry.npmjs.org/through
npm http 304 http://registry.npmjs.org/duplexer
npm http 304 http://registry.npmjs.org/stream-combiner
npm http 304 http://registry.npmjs.org/deps-sort
npm http 304 http://registry.npmjs.org/concat-stream
npm http 304 http://registry.npmjs.org/insert-module-globals
npm http 304 http://registry.npmjs.org/syntax-error
npm http 304 http://registry.npmjs.org/optimist
npm http 304 http://registry.npmjs.org/browser-resolve
npm http 304 http://registry.npmjs.org/inherits
npm http 304 http://registry.npmjs.org/JSONStream
npm http 304 http://registry.npmjs.org/parents
npm http 304 http://registry.npmjs.org/browser-builtins/2.0.4
npm http 304 http://registry.npmjs.org/umd
npm http 304 http://registry.npmjs.org/module-deps
npm http 304 http://registry.npmjs.org/browser-pack
npm http GET http://registry.npmjs.org/bops/0.0.6
npm http GET http://registry.npmjs.org/rfile
npm http GET http://registry.npmjs.org/ruglify
npm http GET http://registry.npmjs.org/uglify-js
npm http GET http://registry.npmjs.org/minimist
npm http 304 http://registry.npmjs.org/minimist
npm http 304 http://registry.npmjs.org/ruglify
npm http GET http://registry.npmjs.org/esprima
npm http 304 http://registry.npmjs.org/uglify-js
npm http 304 http://registry.npmjs.org/bops/0.0.6
npm http 304 http://registry.npmjs.org/esprima
npm http 304 http://registry.npmjs.org/rfile
npm http GET http://registry.npmjs.org/callsite
npm http GET http://registry.npmjs.org/resolve
npm http GET http://registry.npmjs.org/resolve/0.5.1
npm http GET http://registry.npmjs.org/combine-source-map
npm http 304 http://registry.npmjs.org/resolve
npm http 304 http://registry.npmjs.org/callsite
npm http 304 http://registry.npmjs.org/combine-source-map
npm http 304 http://registry.npmjs.org/resolve/0.5.1
npm http GET http://registry.npmjs.org/wordwrap
npm http GET http://registry.npmjs.org/commondir
npm http GET http://registry.npmjs.org/lexical-scope
npm http GET http://registry.npmjs.org/process
npm http 304 http://registry.npmjs.org/wordwrap
npm http 304 http://registry.npmjs.org/commondir
npm http 304 http://registry.npmjs.org/process
npm http 304 http://registry.npmjs.org/lexical-scope
npm http GET http://registry.npmjs.org/base64-js/0.0.2
npm http GET http://registry.npmjs.org/to-utf8/0.0.1
npm http 304 http://registry.npmjs.org/to-utf8/0.0.1
npm http 304 http://registry.npmjs.org/base64-js/0.0.2
npm http GET http://registry.npmjs.org/source-map
npm http GET http://registry.npmjs.org/convert-source-map
npm http GET http://registry.npmjs.org/inline-source-map
npm http 304 http://registry.npmjs.org/source-map
npm http 304 http://registry.npmjs.org/convert-source-map
npm http 304 http://registry.npmjs.org/inline-source-map
npm http GET http://registry.npmjs.org/detective
npm http 304 http://registry.npmjs.org/detective
npm http GET http://registry.npmjs.org/jsonparse/0.0.5
npm http GET http://registry.npmjs.org/esprima/1.0.2
npm http GET http://registry.npmjs.org/escodegen/0.0.15
npm http 304 http://registry.npmjs.org/jsonparse/0.0.5
npm http 304 http://registry.npmjs.org/escodegen/0.0.15
npm http 304 http://registry.npmjs.org/esprima/1.0.2
npm http GET http://registry.npmjs.org/amdefine
npm http GET http://registry.npmjs.org/console-browserify
npm http GET http://registry.npmjs.org/crypto-browserify
npm http GET http://registry.npmjs.org/vm-browserify
npm http GET http://registry.npmjs.org/http-browserify
npm http GET http://registry.npmjs.org/buffer-browserify
npm http GET http://registry.npmjs.org/zlib-browserify
npm http GET http://registry.npmjs.org/constants-browserify
npm http GET http://registry.npmjs.org/os-browserify
npm http 304 http://registry.npmjs.org/amdefine
npm http GET http://registry.npmjs.org/astw
npm http 304 http://registry.npmjs.org/console-browserify
npm http 304 http://registry.npmjs.org/buffer-browserify
npm http 304 http://registry.npmjs.org/vm-browserify
npm http 304 http://registry.npmjs.org/constants-browserify
npm http 304 http://registry.npmjs.org/crypto-browserify
npm http 304 http://registry.npmjs.org/http-browserify
npm http 304 http://registry.npmjs.org/zlib-browserify
npm http 304 http://registry.npmjs.org/os-browserify
npm http 304 http://registry.npmjs.org/astw
npm http GET http://registry.npmjs.org/indexof/0.0.1
npm http GET http://registry.npmjs.org/tape
npm http 304 http://registry.npmjs.org/indexof/0.0.1
npm http 304 http://registry.npmjs.org/tape
npm http GET http://registry.npmjs.org/defined
npm http GET http://registry.npmjs.org/jsonify
npm http GET http://registry.npmjs.org/deep-equal
npm http 304 http://registry.npmjs.org/deep-equal
npm http 304 http://registry.npmjs.org/defined
npm http 304 http://registry.npmjs.org/jsonify
npm http GET http://registry.npmjs.org/Base64
npm http 304 http://registry.npmjs.org/Base64
npm http GET http://registry.npmjs.org/nan
npm http 304 http://registry.npmjs.org/nan

> [email protected] install /opt/hubot/node_modules/hubot-xmpp/node_modules/node-xmpp/node_modules/node-expat
> node-gyp rebuild

make: Entering directory `/opt/hubot/node_modules/hubot-xmpp/node_modules/node-xmpp/node_modules/node-expat/build'
  CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlparse.o
  CC(target) Release/obj.target/expat/deps/libexpat/lib/xmltok.o
../deps/libexpat/lib/xmltok.c:471:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:471:1: warning: (near initialization for ‘latin1_encoding_ns.isName2’) [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:484:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:484:1: warning: (near initialization for ‘latin1_encoding.isName2’) [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:504:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:504:1: warning: (near initialization for ‘ascii_encoding_ns.isName2’) [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:517:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:517:1: warning: (near initialization for ‘ascii_encoding.isName2’) [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:730:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:730:1: warning: (near initialization for ‘little2_encoding_ns.isName2’) [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:749:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:749:1: warning: (near initialization for ‘little2_encoding.isName2’) [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:762:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:762:1: warning: (near initialization for ‘internal_little2_encoding_ns.isName2’) [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:775:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:775:1: warning: (near initialization for ‘internal_little2_encoding.isName2’) [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:871:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:871:1: warning: (near initialization for ‘big2_encoding_ns.isName2’) [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:890:1: warning: missing initializer [-Wmissing-field-initializers]
../deps/libexpat/lib/xmltok.c:890:1: warning: (near initialization for ‘big2_encoding.isName2’) [-Wmissing-field-initializers]
  CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlrole.o
  AR(target) Release/obj.target/deps/libexpat/libexpat.a
  COPY Release/libexpat.a
  CXX(target) Release/obj.target/node_expat/node-expat.o
  SOLINK_MODULE(target) Release/obj.target/node_expat.node
  SOLINK_MODULE(target) Release/obj.target/node_expat.node: Finished
  COPY Release/node_expat.node
make: Leaving directory `/opt/hubot/node_modules/hubot-xmpp/node_modules/node-xmpp/node_modules/node-expat/build'

> [email protected] postinstall /opt/hubot/node_modules/hubot-xmpp/node_modules/node-xmpp
> browserify -d -o node-xmpp-browser.js -r request:browser-request -i node-stringprep -i faye-websocket -i ./srv -i dns ./lib/node-xmpp-browserify.js

[email protected] node_modules/hubot-xmpp
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

WHERE IS THE PROBLEM?

THANKS!!

Hubot connects but is deaf on jabberd2

I'm using jabberd2 (http://codex.xiaoka.com/wiki/jabberd2:start) on Ubuntu Oneiric. Just like in ticket #1, Hubot connects but doesn't respond. The console shows the following error in response to a "hubot help" in the room:

[xmpp error]<message xmlns="jabber:client" to="hubotaccount@myjabberserver/9232fe2f530241d7a18fa0753c2acee97bc63dcf" type="error" from="[email protected]" xmlns:stream="http://etherx.jabber.org/streams"><body>&lt;keyword&gt; tweet - Returns a link to a tweet about &lt;keyword&gt;
&lt;user&gt; is a badass guitarist - assign a role to a user
&lt;user&gt; is not a badass guitarist - remove a role from a user
animate me &lt;query&gt;  - The same thing as `image me`, except adds a few
convert me &lt;expression&gt; to &lt;units&gt; - Convert expression to given units.
help - Displays all of the help commands that Hubot knows about.
help &lt;query&gt; - Displays all help commands that match &lt;query&gt;.
image me &lt;query&gt;    - The Original. Queries Google Images for &lt;query&gt; and
map me &lt;query&gt; - Returns a map view of the area returned by `query`.
math me &lt;expression&gt; - Calculate the given expression.
mustache me &lt;query&gt; - Searches Google Images for the specified query and
mustache me &lt;url&gt;   - Adds a mustache to the specified URL.
pug bomb N - get N pugs
pug me - Receive a pug
ship it - Display a motivation squirrel
show storage - Display the contents that are persisted in redis
show users - Display all users that hubot knows about
translate me &lt;phrase&gt; - Searches for a translation for the &lt;phrase&gt; and then
translate me from &lt;source&gt; into &lt;target&gt; &lt;phrase&gt; - Translates &lt;phrase&gt; from &lt;source&gt; into &lt;target&gt;. Both &lt;source&gt; and &lt;target&gt; are optional
who is &lt;user&gt; - see what roles a user has
youtube me &lt;query&gt; - Searches YouTube for the query and returns the video</body><error type="cancel" code="405"><not-allowed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">You are not in this room</text></error></message>

Thanks!

I went to add auto-reply to presence and found it was already in the codebase. I suppose I should have just tested it myself first :)

Thanks again for an awesome hubot adapter

Upgrade to node-xmpp-client

hubot-xmpp is using a really old version of node-xmpp, which has a bug that prevents you from connecting to certain Jabber servers (at least some versions of OpenFire).

I've been trying to upgrade to the latest version of node-xmpp-client instead, but I'm not sure I'll be able to, as I'm not very familiar with this project.

GTalk, xmpp error: If set, the presence stanza type must be one of 'unavailable', 'subscribe', 'unsubscribe', 'subscribed', 'unsubscribed' or 'error'.

I currently trying the xmpp since the GTalk one dose not support rooms and from its basic GTalk is xmpp. The bot comes online and joins the room, but short after this error, it disappears.

[Thu, 12 Jan 2012 12:45:53 GMT] INFO Hubot XMPP client online
[Thu, 12 Jan 2012 12:45:53 GMT] ERROR [xmpp error]chatIf set, the presence stanza type must be one of 'unavailable', 'subscribe', 'unsubscribe', 'subscribed', 'unsubscribed' or 'error'.

Responds on Chat room, but not DM

Responds on Chat room, but not DM, but the debug mode says it did send it out:

root@host:/var/log/upstart# tail -f hubot.log
[Thu May 08 2014 23:35:46 GMT+0000 (UTC)] WARNING @userForId() is going to be deprecated in 3.0.0 use @robot.brain.userForId()
[Thu May 08 2014 23:35:46 GMT+0000 (UTC)] DEBUG Message '[object Object]' matched regex //^[@]?hubot[:,]?\s*(?:PING$)/i/
[Thu May 08 2014 23:35:46 GMT+0000 (UTC)] DEBUG Sending to [email protected]: PONG
[Thu May 08 2014 23:35:46 GMT+0000 (UTC)] DEBUG Received message: PONG in room: [email protected], from: hubot
[Thu May 08 2014 23:35:58 GMT+0000 (UTC)] DEBUG Unavailability received for user123
[Thu May 08 2014 23:35:58 GMT+0000 (UTC)] WARNING @userForId() is going to be deprecated in 3.0.0 use @robot.brain.userForId()
[Thu May 08 2014 23:36:09 GMT+0000 (UTC)] DEBUG Received message: hubot ping in room: user123@host, from: Spark 2.6.3
[Thu May 08 2014 23:36:09 GMT+0000 (UTC)] WARNING @userForId() is going to be deprecated in 3.0.0 use @robot.brain.userForId()
[Thu May 08 2014 23:36:09 GMT+0000 (UTC)] DEBUG Message '[object Object]' matched regex //^[@]?hubot[:,]?\s*(?:PING$)/i/
[Thu May 08 2014 23:36:09 GMT+0000 (UTC)] DEBUG Sending to user123@host: PONG

Crash in keepalive

Hi,

I get the following error when I start the bot:
/Users/mdarveau/git_workspace/jobot/node_modules/hubot-xmpp/node_modules/node-xmpp/lib/xmpp/session.js:135
this.connection.send(stanza.root())
^
TypeError: Object has no method 'root'
at Client.Session.send (/Users/mdarveau/git_workspace/jobot/node_modules/hubot-xmpp/node_modules/node-xmpp/lib/xmpp/session.js:135:37)
at [object Object]. (/Users/mdarveau/git_workspace/jobot/node_modules/hubot-xmpp/src/xmpp.coffee:79:7, 💯29)
at [object Object].wrapper as _onTimeout
at Timer.listOnTimeout as ontimeout

Seems that the upgrade to the latest xmpp does not work well. Also, reading the xmpp page, they have a recommendation on how to implement keepalive: https://github.com/node-xmpp/node-xmpp#keepalives

hubot xmpp client does not get online

xmpp adapter loads fine. this is the info message after I run
hubot -a xmpp -n my-bot

INFO { username: '[email protected]',
password: 'password',
host: 'jabber.xxx.net',
port: '5223',
rooms: [ { jid: '[email protected]', password: false } ],
keepaliveInterval: 30000,
legacySSL: '1',
preferredSaslMechanism: undefined }

and there are no messages beyond this point. I am clueless to from where should I start debugging. Please help.

`robot.enter` not working

I've tried to figure out in the guts of readPresence why this might be the case, but no dice yet. Any way to get robot.enter to actually fire when someone enters a room?

TypeError: Cannot read property 'split' of undefined

Complete Node.js novice here and I hate to just dump this here but I've got exactly zero ideas as to how to go about getting over this error. Right after running bin/hubot -a xmpp:

> [email protected] install /home/hubot/putinthebot/node_modules/node-stringprep
> node-gyp rebuild

make: Entering directory '/home/hubot/putinthebot/node_modules/node-stringprep/build'
  CXX(target) Release/obj.target/node_stringprep/node-stringprep.o
../node-stringprep.cc: In function 'void ToUnicode(const v8::FunctionCallbackInfo<v8::Value>&)':
../node-stringprep.cc:212:48: warning: 'int32_t uidna_toUnicode_55(const UChar*, int32_t, UChar*, int32_t, int32_t, UParseError*, UErrorCode*)' is deprecated [-Wdeprecated-declarations]
                                    NULL, &error);
                                                ^
In file included from /usr/include/unicode/platform.h:23:0,
                 from /usr/include/unicode/ptypes.h:50,
                 from /usr/include/unicode/umachine.h:44,
                 from /usr/include/unicode/utypes.h:36,
                 from /usr/include/unicode/unistr.h:29,
                 from ../node-stringprep.cc:2:
/usr/include/unicode/uidna.h:622:1: note: declared here
 uidna_toUnicode(const UChar* src, int32_t srcLength,
 ^
../node-stringprep.cc: In function 'void ToASCII(const v8::FunctionCallbackInfo<v8::Value>&)':
../node-stringprep.cc:257:48: warning: 'int32_t uidna_toASCII_55(const UChar*, int32_t, UChar*, int32_t, int32_t, UParseError*, UErrorCode*)' is deprecated [-Wdeprecated-declarations]
                                    NULL, &error);
                                                ^
In file included from /usr/include/unicode/platform.h:23:0,
                 from /usr/include/unicode/ptypes.h:50,
                 from /usr/include/unicode/umachine.h:44,
                 from /usr/include/unicode/utypes.h:36,
                 from /usr/include/unicode/unistr.h:29,
                 from ../node-stringprep.cc:2:
/usr/include/unicode/uidna.h:574:1: note: declared here
 uidna_toASCII(const UChar* src, int32_t srcLength,
 ^
../node-stringprep.cc:267:35: warning: 'int32_t uidna_toASCII_55(const UChar*, int32_t, UChar*, int32_t, int32_t, UParseError*, UErrorCode*)' is deprecated [-Wdeprecated-declarations]
                       NULL, &error);
                                   ^
In file included from /usr/include/unicode/platform.h:23:0,
                 from /usr/include/unicode/ptypes.h:50,
                 from /usr/include/unicode/umachine.h:44,
                 from /usr/include/unicode/utypes.h:36,
                 from /usr/include/unicode/unistr.h:29,
                 from ../node-stringprep.cc:2:
/usr/include/unicode/uidna.h:574:1: note: declared here
 uidna_toASCII(const UChar* src, int32_t srcLength,
 ^
  SOLINK_MODULE(target) Release/obj.target/node_stringprep.node
  COPY Release/node_stringprep.node
make: Leaving directory '/home/hubot/putinthebot/node_modules/node-stringprep/build'
Cannot load StringPrep-0.7.0 bindings (using fallback). You may need to `npm install node-stringprep`
TypeError: Cannot read property 'split' of undefined
  at XmppBot.run (/home/hubot/putinthebot/node_modules/hubot-xmpp/src/xmpp.coffee:28:54, <js>:44:60)
  at Robot.run (/home/hubot/putinthebot/node_modules/hubot/src/robot.coffee:485:5, <js>:415:27)
  at Object.<anonymous> (/home/hubot/putinthebot/node_modules/hubot/bin/hubot:139:8, <js>:151:11)
  at Object.<anonymous> (/home/hubot/putinthebot/node_modules/hubot/bin/hubot:5:1, <js>:154:4)
  at Module._compile (module.js:460:26)

node-stringprep is installed. Not even sure whether this is a problem with hubot-xmpp or node-xmpp, but this only happens with the XMPP adapter. Any thoughts are welcome.

host-unknown when connecting

Hi,
I get the following output after starting Hubot with the XMPP adapter. Any ideas?

$ bin/hubot -a xmpp          
Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'
[Mon Aug 19 2013 17:14:26 GMT+0200 (CEST)] INFO { username: 'botnamehere',
  password: '********',
  host: 'jabber.internal.domain.here',
  port: '5222',
  rooms: [ { jid: 'roomhere', password: false } ],
  keepaliveInterval: 30000,
  legacySSL: undefined,
  preferredSaslMechanism: undefined }
[Mon Aug 19 2013 17:14:27 GMT+0200 (CEST)] ERROR <stream:error xmlns:stream="http://etherx.jabber.org/streams"><host-unknown xmlns="urn:ietf:params:xml:ns:xmpp-streams"/></stream:error>
'host-unknown'
Reconnect in 0
[Mon Aug 19 2013 17:14:27 GMT+0200 (CEST)] ERROR <stream:error xmlns:stream="http://etherx.jabber.org/streams"><host-unknown xmlns="urn:ietf:params:xml:ns:xmpp-streams"/></stream:error>
'host-unknown'
Reconnect in 0
[Mon Aug 19 2013 17:14:28 GMT+0200 (CEST)] ERROR <stream:error xmlns:stream="http://etherx.jabber.org/streams"><host-unknown xmlns="urn:ietf:params:xml:ns:xmpp-streams"/></stream:error>
'host-unknown'
Reconnect in 0
^C%

This is the version dependency I set in my package.json:

"hubot-xmpp": ">= 0.1.0 < 1.0.0"

hipchat

Is anyone using this with hipchat ?
My bot seems to join fine, but doesn't respond at all.

Using these env vars:

export HUBOT_XMPP_USERNAME='[email protected]'
export HUBOT_XMPP_PASSWORD='******'
export HUBOT_XMPP_ROOMS='[email protected],[email protected]'

$ ./bin/hubot -a xmpp -n 'Mr. Hubot'
Cannot load StringPrep-0.2.3 bindings (using fallback). You may need to `npm install node-stringprep`
[Thu Apr 03 2014 09:21:58 GMT-0700 (PDT)] INFO { username: '[email protected]',
  password: '********',
  host: undefined,
  port: undefined,
  rooms: 
   [ { jid: '[email protected]', password: false },
     { jid: '[email protected]', password: false } ],
  keepaliveInterval: 30000,
  legacySSL: undefined,
  preferredSaslMechanism: undefined,
  disallowTLS: undefined }
[Thu Apr 03 2014 09:22:00 GMT-0700 (PDT)] INFO Hubot XMPP client online
[Thu Apr 03 2014 09:22:00 GMT-0700 (PDT)] INFO Hubot XMPP sent initial presence
[Thu Apr 03 2014 09:22:00 GMT-0700 (PDT)] WARNING The HUBOT_AUTH_ADMIN environment variable not set
[Thu Apr 03 2014 09:22:00 GMT-0700 (PDT)] INFO Data for brain retrieved from Redis

screenshot 2014-04-03 09 23 48

Hubot connects and joins chat, but errors out shortly after

I finally got Hubot to join my chat room on my personal Jabber server, and it responds to commands, but after a little while Hubot will die and give me this error:

[Tue Aug 07 2012 15:00:41 GMT-0700 (PDT)] INFO Hubot XMPP client online
[Tue Aug 07 2012 15:00:41 GMT-0700 (PDT)] INFO Hubot XMPP sent initial presence
path.exists is now called fs.exists.

/Users/pawong/Downloads/hubot/node_modules/hubot-xmpp/node_modules/node-xmpp/lib/xmpp/session.js:121
this.connection.send(stanza.root());
^
TypeError: Object has no method 'root'
at Client.Session.send (/Users/pawong/Downloads/hubot/node_modules/hubot-xmpp/node_modules/node-xmpp/lib/xmpp/session.js:121:30)
at Timer.XmppBot.online (/Users/pawong/Downloads/hubot/node_modules/hubot-xmpp/src/xmpp.coffee:87:29)
at Timer.exports.setInterval.timer.ontimeout (timers.js:234:14)

I'm pretty lost, and I'm not sure what these error messages mean. I installed the lastest commit of hubot-xmpp by typing (in the hubot) directory npm install git://github.com/markstory/hubot-xmpp.git#9e2430f4dcae8b53bfbf5110854f00de34e7cf7f.

Any ideas? I'm using npm 1.1.46, and node v0.8.5.

missing dependencies

Hi,

Possibly my lack of experience of Node but just in case it's useful to anyone else, I came across the following dependencies when install hubot-xmpp on CentOS 6.

yum -y install expat-devel
yum -y install libicu-devel
yum -y install node-stringprep # requires EPEL

Would it be better if node-stringprep was included in the package.json for hubot-xmpp?

Thanks,
Bryan

Hubot does not reconnect on disconnect

Hubot does not reconnect when it receives an offline event from the server:

[Tue Feb 18 2014 14:45:50 GMT-0500 (EST)] DEBUG Loading adapter xmpp
[Tue Feb 18 2014 14:45:50 GMT-0500 (EST)] INFO { username: '[email protected]',
password: '********',
host: 'conference.not.a.real.site',
port: '5222',
rooms:
[ { jid: '[email protected]',
password: false } ],
keepaliveInterval: 30000,
legacySSL: undefined,
preferredSaslMechanism: undefined,
disallowTLS: undefined }
[Tue Feb 18 2014 14:45:50 GMT-0500 (EST)] DEBUG Received offline event

Is it possible using this adapter to wrok with gtalk?

I have payed lots of time to get hubot-xmpp adaptor work with gtalk, but failed. btw, hubot-gtalk can work.
Has anyone successfully configed gtalk with hubot-xmpp adaptor?
the command line output:

[Sun Feb 16 2014 12:17:40 GMT+0800 (CST)] INFO { username: '[email protected]',
  password: '********',
  host: 'talk.google.com',
  port: '5222',
  rooms: [ { jid: '', password: false } ],
  keepaliveInterval: 30000,
  legacySSL: '1',
  preferredSaslMechanism: 'PLAIN',
  disallowTLS: 'true' }

I tried hubot time in gtalk client, but no response.

Hubot connects (and joins rooms) but acts deaf

I tried setting up Hubot this evening against my companies ejabberd xmpp system. Hubot seems to connect and joins the prescribed MUC , however it does not list as being online/available, nor does it respond to any commands via the group chat or when prompted directly. I am able to run with the shell adapter and get expected responses, so the issue appears isolated to the xmpp adapter.

Would be happy to help debug the problem, but I am a nodejs newbie, so I am not sure of even where to start.

Remote server not found

<presence to="hubot@server/72d0caab" from="hubot/Hubot" type="error" xmlns:stream="http://etherx.jabber.org/streams"><error code="404" type="cancel"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></presence>

The bot is online but doesn't respond in room.. anyone any idea?

Unable to start adapter using hubot v2.6.3

Below I transcribed the errors I'm getting while running hubot with xmpp adapter.

~/myhubot$ bin/hubot -a xmpp

Here's the current output I'm getting:

~/myhubot$ bin/hubot -a xmpp
Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'
TypeError: Cannot call method 'split' of undefined
  at XmppBot.run (/home/nozomi/myhubot/node_modules/hubot-xmpp/src/xmpp.coffee:13:57, <js>:37:61)
  at Robot.run (/home/nozomi/myhubot/node_modules/hubot/src/robot.coffee:389:5, <js>:351:27)
  at Object.<anonymous> (/home/nozomi/myhubot/node_modules/hubot/bin/hubot:124:8, <js>:141:11)
  at Object.<anonymous> (/home/nozomi/myhubot/node_modules/hubot/bin/hubot:5:1, <js>:144:4)
  at Module._compile (module.js:456:26)

Trying the sugestion "npm install node-stringprep":

~/myhubot$ npm install node-stringprep
npm http GET https://registry.npmjs.org/node-stringprep
npm http 304 https://registry.npmjs.org/node-stringprep

> [email protected] install /home/nozomi/myhubot/node_modules/node-stringprep
> node-gyp rebuild

make: Entering directory `/home/nozomi/myhubot/node_modules/node-stringprep/build'
  CXX(target) Release/obj.target/node_stringprep/node-stringprep.o
  SOLINK_MODULE(target) Release/obj.target/node_stringprep.node
  SOLINK_MODULE(target) Release/obj.target/node_stringprep.node: Finished
  COPY Release/node_stringprep.node
make: Leaving directory `/home/nozomi/myhubot/node_modules/node-stringprep/build'
[email protected] node_modules/node-stringprep

Get list of all clients in a room

I'm having an issue that may be related to #41, but may also be expected behavior. I'm hoping we can confirm whether it's expected behavior or an issue in my environment. It's worth noting that OpenFire is the XMPP server implementation in use here.

When the bot joins a room, robot.brain.data.users is empty. After it sees a message from a user for the first time, an entry for that user is added. Also, clients never seem to receive a presence notification for the bot: at least on Adium, the bot never appears in the list of users in the room, though clients can receive messages sent by the bot to the room.

What I'd like to be able to do is send unsolicited messages generated by POSTs to Hubot's HTTP endpoints to individual users in the room. However, with the current behavior, the bot doesn't "know about" users in the room until they send a message in it.

Is this expected behavior? Are there any workarounds? It sounds like #65 could add functionality that would fix this issue.

ERROR Cannot load adapter xmpp - Error: Cannot find module 'hubot'

/opt/hubot/bin# ./hubot -a xmpp [Fri Oct 05 2012 20:39:20 GMT+0000 (UTC)] ERROR Cannot load adapter xmpp - Error: Cannot find module 'hubot' Error: Cannot find module 'hubot' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:362:17) at require (module.js:378:17) at Object.<anonymous> (/opt/hubot/node_modules/hubot-xmpp/src/xmpp.coffee:9:10) at Object.<anonymous> (/opt/hubot/node_modules/hubot-xmpp/src/xmpp.coffee:272:4) at Module._compile (module.js:449:26) at Object.require.extensions..coffee (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:22:21) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) TypeError: Cannot call method 'on' of null at Object.<anonymous> (/opt/hubot/bin/hubot:105:19) at Object.<anonymous> (/opt/hubot/bin/hubot:109:4) at Module._compile (module.js:449:26) at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:79:25) at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:175:29) at fs.stat.notSources.(anonymous function) (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:150:18) at fs.readFile (fs.js:176:14) at Object.oncomplete (fs.js:297:15)

XEP-0071 Support

Does hubot-xmpp support the passing of messages that conform to XEP-0071 (hrefs, etc)? Trying to send formatted messages but it does not seem to be working. I am seeing literal markup in Adium when sending the following:

<message>
   <body>Test</body>
   <html xmlns='http://jabber.org/protocol/xhtml-im'>
      <body xmlns='http://www.w3.org/1999/xhtml'>
         <p>Test <a href='http://www.domain.com'>link</a></p>
      </body>
   </html>
</message>

Recommendation for hearing messages sent from hubot over xmpp

I want to record all messages within a chat including the responses sent by hubot, but I cannot get hubot to hear itself over xmpp:

robot.hear /(.+)/i, (response) ->

I don't know if this is a limitation of xmpp or I am not doing this the right way. Would appreciate any help.

User attributes saved to the hubot brain are lost on restart

Cross-listing this issue from hubotio/hubot#738 here because I'm wondering if this is related to how hubot-xmpp loads users upon connection to rooms.

Some context:

I'm using scripts such as github-credentials.coffee, harvest.coffee, and hubot-deploy which save attributes to a user within the hubot brain.

Everything persists correctly while hubot is running but as soon as I need to restart hubot (for an upgrade or otherwise), all of the user data is lost.

I'm thinking that this might be related to how hubot loads user data on load, and instead of merging, the loaded user data is overriding the existing user data. Does that sound plausible?

I'm using the hubot-xmpp adapter and the redis-brain.coffee script.

├── [email protected]
├── [email protected]
├── [email protected]

Client roster support

One of the primary things we use Hubot for in our office is to support pure XMPP-based staff chat (essentially XMPP broadcast). In order to make that happen, I extended hubot-xmpp to pull down the client's default roster when it connects, which then gets stored in an array on the robot.

This allows for something like...

robot.catchAll (msg) ->
  from = new Xmpp.JID(msg.message.room)
  text = "#{from.user}: #{msg.message.text}"

  for jid in robot.xmppRoster
    if from.user != jid.user
      params =
        to: jid.toString()
        type: 'chat'

      message = new Xmpp.Element('message', params).c('body').t(text)
      robot.xmppClient.send message

...so we get a lightweight broadcast system that relies only on XMPP.

That's a long way of saying, if I cleaned up my implementation and made a pull request, is this something you could see being in the core library? It may be possible to simply do this as a class that extends XmppBot, but I did this a while ago and pretty quick, so I'm not 100% sure. That may be ideal, though, if possible.

A simple way to use hubot-xmpp as a component?

Hi,

I already tried to simply change

@client = new Xmpp.Client

to

@client = new Xmpp.Component

but this only gives me some undefined errors.

[Sun Oct 06 2013 15:35:17 GMT+0200 (CEST)] ERROR Error: XML parse error
undefined
Reconnect in 0
[Sun Oct 06 2013 15:35:17 GMT+0200 (CEST)] ERROR Error: XML parse error
undefined
Reconnect in 0
[Sun Oct 06 2013 15:35:17 GMT+0200 (CEST)] ERROR Error: XML parse error
undefined
Reconnect in 0
[Sun Oct 06 2013 15:35:17 GMT+0200 (CEST)] ERROR Error: XML parse error
undefined
Reconnect in 0

Since node-xmpp understands components without problems, I'm a bit confused about this error.
Maybe someone has a thought on this?

Thanks a lot in advance!

Regards

no reponse from hubot

So I created a stand-alone hubot. It works fine on the cli. It logs into my openfire server, and enters the specified chatroom successfully. But I get nothing back from it if I message it directly or put a command in the chatroom.

I'm using node v0.10.32, hubot v2.8.2, and hubot-xmpp v0.1.12.

I've tried the simple install described by the readme file, and the setup described in http://www.lordofthejars.com/2012/10/installing-and-running-hubot-terminator.html. I even tried doing the stuff with TLS, just in case, but really that's all working fine since it starttls-es before it auths.

I have run with HUBOT_LOG_LEVEL="debug", and the bot sees all the messages. Just nothing happens.

Any ideas? I'm happy to provide any other detail.

Set nickname to robot name

Currently the nickname for the robot is just the jid minus the host. It would be nicer if we set the bot nickname to @robot.name.

As far as I know, you just need to add a ´nick´ element to your ´presence´ element, like so:

new Xmpp.Element('presence').c('nick', {'xmlns': 'http://jabber.org/protocol/nick'}).t(@robot.name)

Can't create a hubot

coffee -v 
CoffeeScript version 1.1.2
node -v
v0.8.14
hubot --create ./hubot
path.exists is now called `fs.exists`.

/usr/local/lib/node_modules/coffee-script/lib/command.js:15
    return process.binding('stdio').writeError(line + '\n');
                   ^
Error: No such module
    at printWarn (/usr/local/lib/node_modules/coffee-script/lib/command.js:15:20)
    at compileScript (/usr/local/lib/node_modules/coffee-script/lib/command.js:167:7)
    at /usr/local/lib/node_modules/coffee-script/lib/command.js:115:26
    at fs.readFile (fs.js:176:14)
    at Object.oncomplete (fs.js:297:15)

crashes on private messages

We have a hubot 1.11 bot with a manually hacked xmpp adapter that we're trying to upgrade to hubot 2.0. Regular chat works, but if you send a private message to the bot, it crashes. I'm not proficient enough with node/coffee to debug it, so I figured I'd post.

/home/lefay/lefaybot2/node_modules/hubot/node_modules/log/lib/log.js:149
var msg = args[0].replace(/%s/g, function(){
^
TypeError: Object Error: XML parse error has no method 'replace'
at EventEmitter.log (/home/lefay/lefaybot2/node_modules/hubot/node_modules/log/lib/log.js:149:25)
at EventEmitter.error (/home/lefay/lefaybot2/node_modules/hubot/node_modules/log/lib/log.js:202:10)
at XmppBot. (/home/lefay/lefaybot2/node_modules/hubot-xmpp/src/xmpp.coffee:50:32)
at Client. (/home/lefay/lefaybot2/node_modules/hubot-xmpp/src/xmpp.coffee:3:63)
at Client.emit (events.js:64:17)
at Client.error (/home/lefay/lefaybot2/node_modules/hubot-xmpp/node_modules/node-xmpp/lib/xmpp/connection.js:251:10)
at StreamParser. (/home/lefay/lefaybot2/node_modules/hubot-xmpp/node_modules/node-xmpp/lib/xmpp/connection.js:107:14)
at StreamParser.emit (events.js:64:17)
at StreamParser.error (/home/lefay/lefaybot2/node_modules/hubot-xmpp/node_modules/node-xmpp/lib/xmpp/stream_parser.js:94:10)
at [object Object]. (/home/lefay/lefaybot2/node_modules/hubot-xmpp/node_modules/node-xmpp/lib/xmpp/stream_parser.js:46:18)

no response from hubot

I've been trying to get hubot setup for a few hours, and just can't seem to get this adapter working.

The setup: I'm running hubot on ubuntu - clean install for testing. no issues deploying hubot as outlined in instructions, and no issues compiling the hubot-xmpp adapter using "npm install" once the right deps were added.

Hubot connects to my openfire server just fine and shows up in the chat room as expected. It will not respond to any requests though. Turning on debug logging and adding some log statements I can see that the message is getting to the bot and is being passed to the various listeners to be regex matched. At that point I really can't tell what is happening, but it appears as though the message is never matched and passed back up the reponse chain. The Shell adapter works just fine so I thought it must be something to do with the xmpp adapter code.

Any help would be appreciated. I can provide any details needed. Thanks.

Response.reply throws exception

TypeError: Cannot read property 'type' of undefined
    at XmppBot.send (node_modules/hubot-xmpp/src/xmpp.coffee:272:37)
    at XmppBot.reply (node_modules/hubot-xmpp/src/xmpp.coffee:300:30)
    at Response.reply (node_modules/hubot/src/response.coffee:27:48)...

It looks like the XmppBot.reply method passes envelope.user to XmppBot.send, which expects the whole envelope instance.

Send HTML content when available

XEP-0071 describes how to send XHTML over IM, and node-xmpp supports it already, so I would suggest the option to replace any image URL:s in the bot's replies with actual images.

An example would be:

<message>
  <body>Are you feeling down? Have a puppy: http://campuswellbeing.files.wordpress.com/2011/10/cute-puppies-with-worms.jpg
  </body>
  <html xmlns='http://jabber.org/protocol/xhtml-im'>
    <body xmlns='http://www.w3.org/1999/xhtml'>
      <p>Are you feeling down? Have a puppy: <img src='http://campuswellbeing.files.wordpress.com/2011/10/cute-puppies-with-worms.jpg'/></p>
    </body>
  </html>
</message>

The stuff in body is displayed if the receiving client doesn't support rich html content.

I'm not sure what the limitations are on what type of content you can embed (and what the clients can actually display), but I would even consider things like embedding youtube videos when someone sends a youtube link.

What do you think? I'm probably going to hack on it tomorrow, but as I'd rather not maintain my own fork in the long term, I'd like to hear if you're open to it. The features I'm suggesting would of course be strictly optional.

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.