equal
deleted
inserted
replaced
1 #!/usr/bin/ruby |
1 #!/usr/bin/ruby |
2 # vim: set nosta noet ts=4 sw=4: |
2 # vim: set nosta noet ts=4 sw=4: |
3 # |
3 |
|
4 |
4 # An individual list message. |
5 # An individual list message. |
5 # |
6 # |
6 # message = Ezmlm::List::Message.new( list, 24 ) |
7 # message = Ezmlm::List::Message.new( list, 24 ) |
7 # message.thread #=> (a thread object this message is part of) |
8 # message.thread #=> (a thread object this message is part of) |
8 # message.from #=> ["jalon.hermann@example.com"] |
9 # message.from #=> ["jalon.hermann@example.com"] |
29 ### Instantiate a new messag from a +list+ and a +message_number+. |
30 ### Instantiate a new messag from a +list+ and a +message_number+. |
30 ### |
31 ### |
31 def initialize( list, message_number=0 ) |
32 def initialize( list, message_number=0 ) |
32 raise ArgumentError, "Unknown list object." unless list.respond_to?( :listdir ) |
33 raise ArgumentError, "Unknown list object." unless list.respond_to?( :listdir ) |
33 raise ArgumentError, "Invalid message number (impossible)" if message_number < 1 |
34 raise ArgumentError, "Invalid message number (impossible)" if message_number < 1 |
|
35 raise "Archiving is not enabled." unless list.archived? |
34 raise ArgumentError, "Invalid message number (out of list bounds)" if message_number > list.message_count |
36 raise ArgumentError, "Invalid message number (out of list bounds)" if message_number > list.message_count |
35 |
37 |
36 @list = list |
38 @list = list |
37 @id = message_number |
39 @id = message_number |
38 @post = self.load_message |
40 @post = self.load_message |