Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

robot.enter not working as intended #91

Open
anupdhml opened this issue Sep 29, 2015 · 2 comments
Open

robot.enter not working as intended #91

anupdhml opened this issue Sep 29, 2015 · 2 comments
Milestone

Comments

@anupdhml
Copy link
Contributor

Some scripts respond to users entering (or leaving) a room, as in:

robot.enter (msg) ->
  username = msg.message.user.name
  room = msg.message.user.room
  if username isnt robot.name
    robot.logger.info "User #{username} entered the room #{room}"

With hubot-xmpp, this is not working for me when users enter the room for the first time. It works though, when people change their status (eg: available from away), and when hubot joins the room.

Coming from hubot-irc, I expected it to work only when users enter the room for the first time, and not in other cases. Looks like hubot-xmpp is reading presence stanzas and because xmpp sends presence for every person in a room whenever hubot joins the room or when user status changes, robot.enter is being triggered all the time:

https://github.com/markstory/hubot-xmpp/blob/7fbc3a8d25a93defd1b773fb673202e42c82b0e7/src/xmpp.coffee#L343

Even if this was intended, I would still like the functionality to work when people just enter the room (useful for messaging people about the room and its rules, or just general help).

Not a high priority for us right now, but I want to look more into this later. Suggestions are welcome!

@markstory markstory added this to the 0.1.18 milestone Sep 30, 2015
@markstory
Copy link
Contributor

Yeah, I don't know how that would work given how XMPP works under the hood.

@krutaw
Copy link

krutaw commented Jul 25, 2016

Could it be the implementation of XMPP on the server itself? I ask because I'm using this exact same functionality to create a NOC "warroom" where everything is logged (even when people join / disconnect) and it's working flawlessly when used with Cisco Jabber.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants