[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-talk] Problem with lbdb and extra contacts hook



Excerpts from Ali Polatel's message of Sun Sep 20 17:11:04 -0600 2009:
> Ali Polatel yazmış:
> > Hello,
> > I've just started using sup and I'm really loving it.
> > Thanks for the great software.
> > 
> > I have a problem with extra-contact-addresses hook and lbdb.
> > Using the hook in the wiki:
> > contacts = []
> > `lbdbq |awk -F"\t" '{print $2 , "<"$1">"}'`.each { |c| contacts.push(c) }
> > return contacts
> 
> Answering myself, removing return from the last line works as expected!
> I'll see if I can edit the wiki.
> 
By the way, I recently used this hook as well and found it really slow
so I rewrote it to parse the lbdb by hand instead of calling out to
lbdb.  For me, it went from 1.5s to 0.03s.  I edited the wiki as well.
Here's the hook:

file = File.open( ENV['HOME'] + "/.lbdb/m_inmail.list", "r" )
contacts = []
while file.gets
    email,name = split("\t")
    contacts << "#{name} <#{email}>"
end
file.close
contacts

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