aboutsummaryrefslogtreecommitdiff
path: root/lib/chotto/message.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chotto/message.rb')
-rw-r--r--lib/chotto/message.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/chotto/message.rb b/lib/chotto/message.rb
index 282a030..cc3a134 100644
--- a/lib/chotto/message.rb
+++ b/lib/chotto/message.rb
@@ -2,11 +2,12 @@
module Chotto
class Message
+ attr_reader :message, :messages, :db
attr_accessor :tags
- attr_reader :message
- def initialize(msg:)
+ def initialize(msg:, db:)
@message = msg
+ @db = db
@tags = @message.tags
end
@@ -21,6 +22,11 @@ module Chotto
end
end
+ def thread
+ thread_id = message.thread_id
+ MessageThread.new(thread_id: thread_id, db: db)
+ end
+
private
def handle_get_header(header_name)