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

Room and private room specified message. #278

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 8 additions & 0 deletions src/hipchat.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class HipChat extends Adapter
constructor: (robot) ->
super robot
@logger = robot.logger
@rooms = {}
reconnectTimer = null

emote: (envelope, strings...) ->
Expand All @@ -26,6 +27,9 @@ class HipChat extends Adapter
if user?.search?(/@/) >= 0
user # allows user to be a jid string
else
user = @robot.brain.userForName room
@rooms[room]?.jid or
user?.jid or
room # this will happen if someone uses robot.messageRoom(jid, ...)

if not target_jid
Expand All @@ -46,6 +50,9 @@ class HipChat extends Adapter
if user?.search?(/@/) >= 0
user # allows user to be a jid string
else
user = @robot.brain.userForName room
@rooms[room]?.jid or
user?.jid or
room # this will happen if someone uses robot.messageRoom(jid, ...)

if not target_jid
Expand Down Expand Up @@ -173,6 +180,7 @@ class HipChat extends Adapter
if [email protected]_join_public && room.guest_url != ''
@logger.info "Not joining #{room.jid} because it is a public room"
else
@rooms[room.name] = room
joinRoom(room.jid)
else
@logger.error "Can't list rooms: #{errmsg err}"
Expand Down