mumi: Try harder to extract a display name.
authorRicardo Wurmus <rekado@elephly.net>
Fri, 9 Nov 2018 21:32:32 +0000 (22:32 +0100)
committerRicardo Wurmus <rekado@elephly.net>
Fri, 9 Nov 2018 21:32:32 +0000 (22:32 +0100)
* mumi/messages.scm (extract-name): Try to extract a name from the
email address.

mumi/messages.scm

index 7e8863589fe13bedb4b1db3859209a5a4714e940..5104aa124c677b291d718984e91febae640f6c8b 100644 (file)
@@ -41,6 +41,9 @@
 
 (define-public (extract-name address)
   (or (assoc-ref address 'name)
+      (and=> (assoc-ref address 'address)
+             (lambda (address)
+               (string-take address (string-index address #\@))))
       "Somebody"))
 
 (define-public (extract-email address)