github/hubot — pull request #515 by bhuga (2013-06-12 23:54:54+00:00)
Title: Campfire room locking fun and excitement

This pull lets you see whether a message was private when sent and respond in a locked room via Campfire.

#### Viewing message visibility:
```
robot.respond /PING$/, (msg) ->
if msg.message.private
msg.send "PONG"
else
msg.send "Sorry, I only respond to pings in locked rooms."
```

`private` will be `true` for locked rooms, `false` for unlocked rooms, and `undefined` for rooms where no lock message has been seen since restart.

#### Setting responses as private:
```
robot.respond /PING$/, (msg) ->
msg.locked "PONG privately"
```

If the room is locked before the trigger, hubot will just answer. If not, he'll lock it, answer, and unlock it.

As a side effect of how I implemented all of this, you can now do callbacks after send:

```
robot.respond /PING$/, (msg) ->
msg.send "hello", ->
console.log "This is printed after sending hello"
```

I'm not sure of the use case for that, but I don't see what it hurts.