lib/hipbot/message.rb in hipbot-0.0.3 vs lib/hipbot/message.rb in hipbot-0.0.5
- old
+ new
@@ -7,17 +7,25 @@
self.sender = sender
end
def recipients
results = raw_body.scan(/@(\w+)/) + raw_body.scan(/@"(.*)"/)
- results.flatten
+ results.flatten.uniq
end
def for? recipient
recipients.include? recipient.to_s.gsub(/\s+/, '')
end
def strip_recipient body
body.gsub(/^@\w+\W*/, '')
+ end
+
+ def sender_name
+ sender.split.first
+ end
+
+ def mentions
+ recipients[1..-1]
end
end
end