From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.228.134 with SMTP id je6cs197399icb; Sun, 2 Jan 2011 08:36:02 -0800 (PST) Received: by 10.229.222.194 with SMTP id ih2mr17482649qcb.197.1293986162293; Sun, 02 Jan 2011 08:36:02 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id s14si34324793qcp.59.2011.01.02.08.36.02; Sun, 02 Jan 2011 08:36:02 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 56A821858377; Sun, 2 Jan 2011 11:35:47 -0500 (EST) Received: from gateway0.EECS.Berkeley.EDU (gateway0.EECS.Berkeley.EDU [169.229.60.87]) by rubyforge.org (Postfix) with ESMTP id D21EC1858376 for ; Sun, 2 Jan 2011 11:13:41 -0500 (EST) Received: from samurai.icir.org (samurai.ICIR.org [192.150.187.48]) (authenticated bits=0) by gateway0.EECS.Berkeley.EDU (8.14.4/8.13.5) with ESMTP id p02GDdp7022286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Sun, 2 Jan 2011 08:13:41 -0800 (PST) From: Matthias Vallentin To: sup-talk In-reply-to: <20101227100718.GL60419@icsi.berkeley.edu> References: <20101227100718.GL60419@icsi.berkeley.edu> Date: Sun, 02 Jan 2011 08:13:39 -0800 Message-Id: <1293984326-sup-8884@samurai.icir.org> User-Agent: Sup/git Subject: Re: [sup-talk] message.list_address weirdness X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org On Dec 27 2010 at 02:07AM PST, Matthias Vallentin wrote: > I cannot get message.list_address to match to add labels before adding > messages although the messages definitively have the List-Post header. Actually, the proposed changes will cause a crash when replying to a list address (i.e., hitting 'G'), which expects message.list_address to return a Person object rather than a string containing the email address. This is inconsistent with the wiki [1] and started my confusion in the first place. Automatically adding labels for mailing lists would then change from if message.list_address =~ /sup-talk/ message.add_label "sup" message.add_label "list" end to if message.list_address and message.list_address.email =~ /sup-talk/ message.add_label "sup" message.add_label "list" end in order to work correctly. In [1], list_address is documented to be of type String, which should probably be changed to type Person. I find the naming (list_address) slightly misleading because it suggest a plain email address. What about introducing a new member message.list that returns a Person object and making message.list_{address,subscribe,unsubscribe} return a string? Matthias [1] http://sup.rubyforge.org/wiki/wiki.pl?AutoAddLabelsToNewMessages _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk