Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] message.list_address weirdness
@ 2010-12-27 10:07 Matthias Vallentin
  2011-01-02 16:13 ` Matthias Vallentin
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Vallentin @ 2010-12-27 10:07 UTC (permalink / raw)
  To: sup-talk

I cannot get message.list_address to match to add labels before adding
messages although the messages definitively have the List-Post header.
I found that message.list_address is sometimes a Person instance, which 
suggest a bug in the code assigning the instance variable @list_address
(reformatted):

@list_address = if header["list-post"]
                  address = if header["list-post"] =~ /mailto:(.*?)[>\s$]/
                              $1
                            elsif header["list-post"] =~ /@/
                              header["list-post"] # just try the whole fucking thing
                            end
                  address && Person.from_address(address)
                elsif header["x-mailing-list"]
                  Person.from_address header["x-mailing-list"]
                end

This code looks erroneous in that Person.from_address returns a Person
instance in the elsif branch. Shouldn't that be a string of the address
instead, i.e.,

    Person.from_address(header["x-mailing-list"]).email

? The same problem seems to appear in the conjunction

    address && Person.from_address(address)

which should in my opinion be

    address && Person.from_address(address).email

. Does that makes sense?

   Matthias
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-02 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-27 10:07 [sup-talk] message.list_address weirdness Matthias Vallentin
2011-01-02 16:13 ` Matthias Vallentin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox