Skip to content

Commit

Permalink
Auto add name before message which sent from query window
Browse files Browse the repository at this point in the history
  • Loading branch information
doitian committed Dec 27, 2011
1 parent a1ee96d commit 88a44a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class IrcBot extends Adapter

bot.addListener 'message', (from, to, message) ->
console.log "From #{from} to #{to}: #{message}"

user = self.userForName from
unless user?
id = (new Date().getTime() / 1000).toString().replace('.','')
Expand All @@ -83,6 +83,8 @@ class IrcBot extends Adapter
console.log "#{to} <#{from}> #{message}"
else
user.room = null
unless message.indexOf(to) == 0
message = "#{to}: #{message}"
console.log "msg <#{from}> #{message}"

self.receive new Robot.TextMessage(user, message)
Expand Down

0 comments on commit 88a44a3

Please sign in to comment.