Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: Matthias Vallentin <vallentin@icsi.berkeley.edu>
To: sup-talk@rubyforge.org
Subject: [sup-talk] message.list_address weirdness
Date: Mon, 27 Dec 2010 02:07:18 -0800	[thread overview]
Message-ID: <20101227100718.GL60419@icsi.berkeley.edu> (raw)

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


             reply	other threads:[~2010-12-27 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-27 10:07 Matthias Vallentin [this message]
2011-01-02 16:13 ` Matthias Vallentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101227100718.GL60419@icsi.berkeley.edu \
    --to=vallentin@icsi.berkeley.edu \
    --cc=sup-talk@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox