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

When invited to a room the bot should not join if the room is public #298

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 9 additions & 3 deletions src/hipchat.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,15 @@ class HipChat extends Adapter
@logger.info "Not joining #{jid} because it is blacklisted"
return

@logger.info "Joining #{jid}"
connector.join jid

connector.getRooms (err, rooms, stanza) =>
if rooms
for room in rooms
if [email protected]_join_public && room.guest_url != '' && room.jid == jid
@logger.info "Not joining #{room.jid} because it is a public room"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't join the room, you won't be able to receive messages from that room. Is that the objective?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeh, if you tell hubot not to join public rooms it only applies at boot. Thought if invited whilst it is running it will then join a public room

return
else if room.jid == jid
connector.join jid
return
# Fetch user info
connector.getRoster (err, users, stanza) =>
return init.reject err if err
Expand Down