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

Detecting when someone joins a room? #11

Closed
borski opened this issue Dec 11, 2013 · 11 comments
Closed

Detecting when someone joins a room? #11

borski opened this issue Dec 11, 2013 · 11 comments

Comments

@borski
Copy link

borski commented Dec 11, 2013

Is there functionality for detecting when a new user joins and responding to them automatically? Or being able to tell if they are a real user or 'guest'?

@bartoszkopinski
Copy link
Collaborator

Hey,
that's a good idea to add as a reaction trigger.
Right now joining is implemented in here so the only way would be to monkey patch this a little bit.

It should be possible to tell guest users apart as they have empty email / mention attributes.

@borski
Copy link
Author

borski commented Dec 11, 2013

Any chance you think you'd have time to implement that piece? I'm new to hipbot :(

@bartoszkopinski
Copy link
Collaborator

Sure, will check on this tomorrow morning.

@borski
Copy link
Author

borski commented Dec 12, 2013

Any luck on this?

@bartoszkopinski
Copy link
Collaborator

Yeah, sorry. I felt into refactoring loop.
I want to finish this till tomorrow, will let you know.

@borski
Copy link
Author

borski commented Dec 13, 2013

How goes? :) Thanks for working on it!

@bartoszkopinski
Copy link
Collaborator

@borski I've added new reaction to the latest release.

class MyBot < Hipbot::Bot
  # ...
  on_presence do |status|
    puts "Triggered by #{sender.name} in #{room.name} with status: #{status}"
  end
end

I guess it will be also triggered by Hipbot joining and receiving presence statuses once for everyone in the room (on start or invite). I haven't found perfect workaround for this case yet.

Let me know if that helps. I'm still working on easy way to distinguish guest users.

@borski
Copy link
Author

borski commented Dec 15, 2013

This is pretty great - is there a way to make Hipbot only join a single room? Even if he's invited into a different room by being @mentioned?

@bartoszkopinski
Copy link
Collaborator

How about removing Hipbot from other rooms? (unless they're public)

You can specify room(s) to join on start, but it'll still auto-join on invite/mention.
Hmm, I guess I can change that...

class MyHipbot < Hipbot::Bot
  configure do |c|
    # ...
    c.join = "room name"
  end
end

@borski
Copy link
Author

borski commented Dec 15, 2013

Where is the auto-join on mention code? Can I change that?

On Sun, Dec 15, 2013 at 7:28 AM, Bartosz Kopiński
notifications@github.com wrote:

How about removing Hipbot from other rooms?
You can specify room(s) to join on start, but it'll still auto-join on invite/mention.
I guess I can change that.

class MyHipbot < Hipbot::Bot
  configure do |c|
    # ...
    c.join = "room name"
  end
end

Reply to this email directly or view it on GitHub:
#11 (comment)

@bartoszkopinski
Copy link
Collaborator

The invite reaction is here.
I'll change that to respect c.join setting, will it be reasonable?

bartoszkopinski pushed a commit that referenced this issue Apr 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants