[mew-dist 28374] get_parid() in cmew

KOIE Hidetaka ( 鯉江英隆 ) hide at example.com
2008年 5月 1日 (木) 18:46:24 JST


References:に一行に複数のidが入っている場合があるので
cmewのget_parid()をいじってみました。
- in-reply-to:とreferences:をこまぎれにするときにSPCやTABもゆるす
- in-reply-to:とreferences:の中にゴミが混ざっていたらすてる

Index: cmew
===================================================================
RCS file: /cvsmew/mew/bin/cmew,v
retrieving revision 1.17
diff -c -r1.17 cmew
*** cmew	10 Apr 2008 14:30:13 -0000	1.17
--- cmew	1 May 2008 09:42:33 -0000
***************
*** 87,100 ****
    # (2) The References contains one or more IDs, use the last one.
    # (3) The In-Reply-To contains two or more IDs, use the first one.
    irt = []
!   irt = msg['In-Reply-To'].split(/\n/) if msg['In-Reply-To']
!   return check_id(irt[0]) if irt.size == 1
    ref = []
!   ref = msg['References'].split(/\n/) if msg['References']
!   return check_id(ref.pop) if ref.size != 0
!   irt.each {|id|
!     return id if check_id(id)
!   }
    return nil
  end
  
--- 87,100 ----
    # (2) The References contains one or more IDs, use the last one.
    # (3) The In-Reply-To contains two or more IDs, use the first one.
    irt = []
!   irt = msg['In-Reply-To'].split(/[ \t\n]+/) if msg['In-Reply-To']
!   irt.delete_if {|id| !check_id(id) }
!   return irt[0] if irt.size == 1
    ref = []
!   ref = msg['References'].split(/[ \t\n]+/) if msg['References']
!   ref.delete_if {|id| !check_id(id) }
!   return ref.pop if ref.size > 0
!   return irt[0] if irt.size > 1
    return nil
  end
  
--
KOIE Hidetaka <hide at example.com>



Mew-dist メーリングリストの案内