aiwilliams-mlist 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,15 @@
1
+ *0.1.4 [] (January 7, 2009)
2
+
3
+ * Fixed bug where default email server was not allowing for settings
4
+ * Made subject for reply place 're:' in front of the list label
5
+ * Added really simple tree support. Really simple.
6
+
7
+ *0.1.3 [] (January 7, 2009)
8
+
9
+ * Generating message id as UUID
10
+ * Allowing setting of domain for message id
11
+ * Fixed bug in storing message id
12
+
1
13
  *0.1.2 [] (January 7, 2009)
2
14
 
3
15
  * Added references header when creating a reply post.
data/README CHANGED
@@ -30,6 +30,14 @@ There is a LOT to do: segmenting, i18n, backscatter - only the Mailman developer
30
30
  know what else. I have enough experience to know that rewrites are NEVER as easy
31
31
  as they seem. Alas, I go boldly forward.
32
32
 
33
+ ==== Thread Trees
34
+
35
+ We need to implement this at the database level. For now, each MList::Message
36
+ simply points to it's parent. I believe the implementation will ultimately be
37
+ extracted from awesome_nested_set. That's a bit of work, so for now, the
38
+ MList::Thread provides a couple of methods, roots and children, to support the
39
+ simplest display of the tree.
40
+
33
41
  ==== Extracting 'from' IP address from emails is not implemented
34
42
 
35
43
  http://compnetworking.about.com/od/workingwithipaddresses/qt/ipaddressemail.htm
@@ -87,7 +95,6 @@ environment.rb after the initialize block (our gem needs to have been loaded):
87
95
  end
88
96
 
89
97
  MLIST_SERVER = MList::Server.new(
90
- :domain => 'myapp.com', # This is optional
91
98
  :list_manager => MList::Manager::Database.new,
92
99
  :email_server => MList::EmailServer::Default.new(
93
100
  MList::EmailServer::Pop.new(
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 1
3
- :patch: 3
3
+ :patch: 4
4
4
  :major: 0
@@ -2,8 +2,8 @@ module MList
2
2
  module EmailServer
3
3
 
4
4
  class Default < Base
5
- def initialize(incoming_server, outgoing_server)
6
- super({})
5
+ def initialize(incoming_server, outgoing_server, settings = {})
6
+ super(settings)
7
7
  @incoming_server, @outgoing_server = incoming_server, outgoing_server
8
8
  @incoming_server.receiver(self)
9
9
  end
@@ -132,8 +132,13 @@ module MList
132
132
 
133
133
  def list_subject(message)
134
134
  prefix = "[#{label}]"
135
- subject = message.subject.gsub(%r(#{Regexp.escape(prefix)}\s*), '')
136
- subject.gsub!(%r{(re:\s*){2,}}i, 'Re: ')
135
+ subject = message.subject.dup
136
+ if subject =~ /re: /i
137
+ subject.gsub!(%r{(re:\s*)}i, '')
138
+ prefix = 'Re: ' + prefix
139
+ end
140
+ subject.gsub!(/\[.*?\]/, '')
141
+ subject.strip!
137
142
  "#{prefix} #{subject}"
138
143
  end
139
144
 
@@ -5,6 +5,10 @@ module MList
5
5
  belongs_to :mail_list, :class_name => 'MList::MailList', :counter_cache => :threads_count
6
6
  has_many :messages, :class_name => 'MList::Message', :dependent => :delete_all
7
7
 
8
+ def children(message)
9
+ messages.select {|m| m.parent == message}
10
+ end
11
+
8
12
  def first?(message)
9
13
  messages.first == message
10
14
  end
@@ -23,6 +27,10 @@ module MList
23
27
  messages[i - 1] if i > 0
24
28
  end
25
29
 
30
+ def roots
31
+ messages.select {|m| m.parent.nil?}
32
+ end
33
+
26
34
  def subject
27
35
  messages.first.subject
28
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aiwilliams-mlist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Williams