]> granicus.if.org Git - neomutt/log
neomutt
5 years agoAdd tests for mutt_addrlist_write + make it more readable
Pietro Cerutti [Wed, 22 May 2019 10:09:00 +0000 (10:09 +0000)]
Add tests for mutt_addrlist_write + make it more readable

5 years agoAdd (basic) tests for mutt_addrlist_to_(intl|local)
Pietro Cerutti [Wed, 22 May 2019 09:00:42 +0000 (09:00 +0000)]
Add (basic) tests for mutt_addrlist_to_(intl|local)

5 years agoAdd tests for mutt_addrlist_remove
Pietro Cerutti [Tue, 21 May 2019 13:01:25 +0000 (13:01 +0000)]
Add tests for  mutt_addrlist_remove

5 years agoAdd tests formutt_addrlist_remove_xrefs
Pietro Cerutti [Tue, 21 May 2019 12:53:51 +0000 (12:53 +0000)]
Add tests formutt_addrlist_remove_xrefs

5 years agoSimplify mutt_default_from
Pietro Cerutti [Mon, 20 May 2019 16:11:57 +0000 (16:11 +0000)]
Simplify mutt_default_from

5 years agoAdd helper to create and populate an Address, avoid leaks in tests
Pietro Cerutti [Mon, 20 May 2019 16:10:12 +0000 (16:10 +0000)]
Add helper to create and populate an Address, avoid leaks in tests

5 years agoSort address functions by name
Pietro Cerutti [Mon, 20 May 2019 15:19:25 +0000 (15:19 +0000)]
Sort address functions by name

5 years agoAdd tests for mutt_addrlist_qualify
Pietro Cerutti [Mon, 20 May 2019 11:44:41 +0000 (11:44 +0000)]
Add tests for mutt_addrlist_qualify

5 years agoAdd tests for mutt_addrlist_parse2
Pietro Cerutti [Mon, 20 May 2019 11:37:07 +0000 (11:37 +0000)]
Add tests for mutt_addrlist_parse2

5 years agoAvoid leak in the test for mutt_addrlist_parse
Pietro Cerutti [Mon, 20 May 2019 11:36:53 +0000 (11:36 +0000)]
Avoid leak in the test for mutt_addrlist_parse

5 years agoSlightly refactor mutt_addrlist_parse2
Pietro Cerutti [Mon, 20 May 2019 11:36:22 +0000 (11:36 +0000)]
Slightly refactor mutt_addrlist_parse2

5 years agoAdd tests for mutt_addrlist_parse + slight refactor and fix return value
Pietro Cerutti [Mon, 20 May 2019 11:20:50 +0000 (11:20 +0000)]
Add tests for mutt_addrlist_parse + slight refactor and fix return value

5 years agoAdd tests for mutt_addrlist_count_recips
Pietro Cerutti [Mon, 20 May 2019 10:45:51 +0000 (10:45 +0000)]
Add tests for mutt_addrlist_count_recips

5 years agoRename mutt_addrlist_free_all into mutt_addrlist_clear, remove freeing functions
Pietro Cerutti [Sun, 19 May 2019 12:47:18 +0000 (12:47 +0000)]
Rename mutt_addrlist_free_all into mutt_addrlist_clear, remove freeing functions

No facilities are provided for the heap allocation and freeing of
AddressLists. The suggested usage is to to have AddressLists as
variables on the stack.

5 years agoKill duplicate copyright line
Pietro Cerutti [Sun, 19 May 2019 11:20:25 +0000 (11:20 +0000)]
Kill duplicate copyright line

5 years agoRename mutt_addrlist_has_recips to mutt_addrlist_count_recips and add tests
Pietro Cerutti [Sun, 19 May 2019 11:18:53 +0000 (11:18 +0000)]
Rename mutt_addrlist_has_recips to mutt_addrlist_count_recips and add tests

5 years agoRevert queue.h formatting
Richard Russon [Sun, 19 May 2019 10:44:03 +0000 (11:44 +0100)]
Revert queue.h formatting

5 years agotidy code
Richard Russon [Sun, 19 May 2019 10:42:33 +0000 (11:42 +0100)]
tidy code

- NULL pointers
- variable case
- rename function
- sprinkle credit

5 years agoBoolify uses of Address' group
Pietro Cerutti [Sun, 19 May 2019 09:29:11 +0000 (09:29 +0000)]
Boolify uses of Address' group

5 years agoAdd tests for mutt_addrlist_free
Pietro Cerutti [Sun, 19 May 2019 09:06:15 +0000 (09:06 +0000)]
Add tests for mutt_addrlist_free

5 years agoAdd tests for mutt_addrlist_free_one
Pietro Cerutti [Sun, 19 May 2019 08:53:25 +0000 (08:53 +0000)]
Add tests for mutt_addrlist_free_one

5 years agoAdd tests for mutt_addrlist_free_all
Pietro Cerutti [Sun, 19 May 2019 08:37:00 +0000 (08:37 +0000)]
Add tests for mutt_addrlist_free_all

5 years agoAdd tests for mutt_addrlist_equal
Pietro Cerutti [Sun, 19 May 2019 08:28:02 +0000 (08:28 +0000)]
Add tests for mutt_addrlist_equal

5 years agoRun clang-format over test/address
Pietro Cerutti [Sun, 19 May 2019 08:19:19 +0000 (08:19 +0000)]
Run clang-format over test/address

5 years agoAdd test for mutt_addrlist_dedupe, fix mutt_addrlist_parse
Pietro Cerutti [Sun, 19 May 2019 08:17:28 +0000 (08:17 +0000)]
Add test for mutt_addrlist_dedupe, fix mutt_addrlist_parse

5 years agoAdd tests for mutt_addrlist_copy
Pietro Cerutti [Sat, 18 May 2019 17:07:30 +0000 (17:07 +0000)]
Add tests for mutt_addrlist_copy

5 years agoAdd test for mutt_addrlist_append and mutt_addrlist_prepend
Pietro Cerutti [Sat, 18 May 2019 16:51:50 +0000 (16:51 +0000)]
Add test for mutt_addrlist_append and mutt_addrlist_prepend

5 years agoAdd tests for mutt_addr_valid_msgid
Pietro Cerutti [Sat, 18 May 2019 16:45:28 +0000 (16:45 +0000)]
Add tests for mutt_addr_valid_msgid

5 years agoAdd tests for mutt_addr_free
Pietro Cerutti [Sat, 18 May 2019 16:32:13 +0000 (16:32 +0000)]
Add tests for mutt_addr_free

5 years agoAdd tests for mutt_addr_copy
Pietro Cerutti [Sat, 18 May 2019 16:28:27 +0000 (16:28 +0000)]
Add tests for mutt_addr_copy

5 years agoAdd tests for mutt_addr_cat, explain what it does does in the Doxygen block
Pietro Cerutti [Sat, 18 May 2019 16:20:34 +0000 (16:20 +0000)]
Add tests for mutt_addr_cat, explain what it does does in the Doxygen block

5 years agoAdd tests for mutt_addr_cmp
Pietro Cerutti [Sat, 18 May 2019 16:20:15 +0000 (16:20 +0000)]
Add tests for mutt_addr_cmp

5 years agoremove 'mutt_' from static functions
Richard Russon [Sat, 18 May 2019 11:55:08 +0000 (12:55 +0100)]
remove 'mutt_' from static functions

5 years agotest: update basic address tests
Richard Russon [Fri, 17 May 2019 21:37:08 +0000 (22:37 +0100)]
test: update basic address tests

5 years agodoxy: fix comments
Richard Russon [Fri, 17 May 2019 22:24:14 +0000 (23:24 +0100)]
doxy: fix comments

5 years agoProvide mutt_addrlist_append and mutt_addrlist_prepend
Pietro Cerutti [Fri, 17 May 2019 13:42:58 +0000 (13:42 +0000)]
Provide mutt_addrlist_append and mutt_addrlist_prepend

These are one-liners that call TAILQ_INSERT_TAIL and TAILQ_INSERT_HEAD,
but the macros have the ugly side-effect of evaluating their arguments
multiple times, so TAILQ_INSERT_TAIL(list, new_element()); doesn't do
what you would expect.

5 years agoRename mutt_addresslist_* to mutt_addrlist_*
Pietro Cerutti [Fri, 17 May 2019 13:12:54 +0000 (13:12 +0000)]
Rename mutt_addresslist_* to mutt_addrlist_*

5 years agoMerge AddressNode into Address
Pietro Cerutti [Fri, 17 May 2019 11:55:55 +0000 (11:55 +0000)]
Merge AddressNode into Address

5 years agoRemove "next" pointer from struct Address: conversion to TAILQ is complete
Pietro Cerutti [Thu, 16 May 2019 16:42:05 +0000 (16:42 +0000)]
Remove "next" pointer from struct Address: conversion to TAILQ is complete

5 years agoCleanup Address API: mutt_addrlist_to_(intl|local) -> mutt_addresslist_to_(intl|local)
Pietro Cerutti [Thu, 16 May 2019 16:34:59 +0000 (16:34 +0000)]
Cleanup Address API: mutt_addrlist_to_(intl|local) -> mutt_addresslist_to_(intl|local)

5 years agoCleanup Address API: mutt_addrlist_dedupe -> mutt_addresslist_dedupe
Pietro Cerutti [Thu, 16 May 2019 15:44:11 +0000 (15:44 +0000)]
Cleanup Address API: mutt_addrlist_dedupe -> mutt_addresslist_dedupe

5 years agoCleanup Address API: unexpose mutt_addr_set_(intl|local)
Pietro Cerutti [Thu, 16 May 2019 15:23:45 +0000 (15:23 +0000)]
Cleanup Address API: unexpose mutt_addr_set_(intl|local)

5 years agoCleanup Address API: mutt_addr_remove_xrefs -> mutt_addresslist_remove_xrefs
Pietro Cerutti [Thu, 16 May 2019 15:14:56 +0000 (15:14 +0000)]
Cleanup Address API: mutt_addr_remove_xrefs -> mutt_addresslist_remove_xrefs

5 years agoCleanup Address API: mutt_addr_remove_from_list -> mutt_addresslist_remove
Pietro Cerutti [Thu, 16 May 2019 14:52:33 +0000 (14:52 +0000)]
Cleanup Address API: mutt_addr_remove_from_list -> mutt_addresslist_remove

5 years agoCleanup Address API: unexpose mutt_addr_mbox_to_udomain
Pietro Cerutti [Thu, 16 May 2019 14:35:04 +0000 (14:35 +0000)]
Cleanup Address API: unexpose mutt_addr_mbox_to_udomain

5 years agoCleanup Address API: unexpose mutt_addr_is_(intl|local)
Pietro Cerutti [Thu, 16 May 2019 14:28:21 +0000 (14:28 +0000)]
Cleanup Address API: unexpose mutt_addr_is_(intl|local)

5 years agoFix match_user
Pietro Cerutti [Thu, 16 May 2019 14:06:18 +0000 (14:06 +0000)]
Fix match_user

5 years agoFix and refactor mutt_is_list_recipient and mutt_is_subscribed_list_recipient
Pietro Cerutti [Thu, 16 May 2019 13:29:38 +0000 (13:29 +0000)]
Fix and refactor mutt_is_list_recipient and mutt_is_subscribed_list_recipient

5 years agoCleanup Address API: mutt_addr_write
Pietro Cerutti [Thu, 16 May 2019 13:17:31 +0000 (13:17 +0000)]
Cleanup Address API: mutt_addr_write

5 years agoCleanup Address API: mutt_addresslist_qualify
Pietro Cerutti [Thu, 16 May 2019 12:07:25 +0000 (12:07 +0000)]
Cleanup Address API: mutt_addresslist_qualify

5 years agoCleanup Address API: parse and free
Pietro Cerutti [Thu, 16 May 2019 11:57:25 +0000 (11:57 +0000)]
Cleanup Address API: parse and free

5 years agoCleanup Address API: mutt_addr_cmp_strict -> mutt_addresslist_equal
Pietro Cerutti [Thu, 16 May 2019 11:30:10 +0000 (11:30 +0000)]
Cleanup Address API: mutt_addr_cmp_strict -> mutt_addresslist_equal

5 years agoFix recursive alias lookup
Pietro Cerutti [Thu, 16 May 2019 11:08:39 +0000 (11:08 +0000)]
Fix recursive alias lookup

5 years agoFix variadic function
Pietro Cerutti [Thu, 16 May 2019 09:23:46 +0000 (09:23 +0000)]
Fix variadic function

5 years agoConvert Envelope addresses to AddressList
Pietro Cerutti [Wed, 15 May 2019 16:17:07 +0000 (16:17 +0000)]
Convert Envelope addresses to AddressList

5 years agoConvert Alias to use AddressList
Pietro Cerutti [Tue, 14 May 2019 11:53:21 +0000 (11:53 +0000)]
Convert Alias to use AddressList

5 years agoConvert mutt_addr_remove_from_list and mutt_addr_remove_xrefs API to AddressList
Pietro Cerutti [Mon, 13 May 2019 13:14:57 +0000 (13:14 +0000)]
Convert mutt_addr_remove_from_list and mutt_addr_remove_xrefs API to AddressList

5 years agoUse AddressList in mutt_addrlist_to_intl and mutt_addrlist_to_local
Pietro Cerutti [Mon, 13 May 2019 12:14:20 +0000 (12:14 +0000)]
Use AddressList in mutt_addrlist_to_intl and mutt_addrlist_to_local

5 years agoUse AddressList in mutt_addr_write
Pietro Cerutti [Mon, 13 May 2019 12:13:56 +0000 (12:13 +0000)]
Use AddressList in mutt_addr_write

5 years agoTidy Address free'ing functions
Pietro Cerutti [Mon, 13 May 2019 12:13:22 +0000 (12:13 +0000)]
Tidy Address free'ing functions

5 years agoUse AddressList in mutt_addr_remove_xrefs
Pietro Cerutti [Mon, 13 May 2019 12:12:07 +0000 (12:12 +0000)]
Use AddressList in mutt_addr_remove_xrefs

5 years agoUse AddressList in mutt_addr_search
Pietro Cerutti [Mon, 13 May 2019 12:26:06 +0000 (12:26 +0000)]
Use AddressList in mutt_addr_search

5 years agoUse AddressList in mutt_addr_has_recips
Pietro Cerutti [Mon, 13 May 2019 12:25:48 +0000 (12:25 +0000)]
Use AddressList in mutt_addr_has_recips

5 years agoUse AddressList in mutt_addr_cmp_strict
Pietro Cerutti [Mon, 13 May 2019 12:25:29 +0000 (12:25 +0000)]
Use AddressList in mutt_addr_cmp_strict

5 years agoUse AddressList in mutt_addr_append
Pietro Cerutti [Mon, 13 May 2019 12:25:00 +0000 (12:25 +0000)]
Use AddressList in mutt_addr_append

5 years agoUse AddressList in mutt_addr_qualify
Pietro Cerutti [Mon, 13 May 2019 12:24:39 +0000 (12:24 +0000)]
Use AddressList in mutt_addr_qualify

5 years agoUse AddressList in mutt_addr_remove_from_list
Pietro Cerutti [Mon, 13 May 2019 12:24:15 +0000 (12:24 +0000)]
Use AddressList in mutt_addr_remove_from_list

5 years agoUse AddressList in mutt_addr_free, implement mutt_addresslist_free_one
Pietro Cerutti [Mon, 13 May 2019 12:22:34 +0000 (12:22 +0000)]
Use AddressList in mutt_addr_free, implement mutt_addresslist_free_one

5 years agoUse AddressList in mutt_addr_copy_list
Pietro Cerutti [Mon, 13 May 2019 12:21:09 +0000 (12:21 +0000)]
Use AddressList in mutt_addr_copy_list

5 years agoImplement mutt_addresslist_new
Pietro Cerutti [Mon, 13 May 2019 12:23:52 +0000 (12:23 +0000)]
Implement mutt_addresslist_new

5 years agoConst'ify parameter to mutt_addr_copy
Pietro Cerutti [Mon, 13 May 2019 12:18:11 +0000 (12:18 +0000)]
Const'ify parameter to mutt_addr_copy

5 years agoUse AddressList in mutt_addr_parse_list
Pietro Cerutti [Fri, 10 May 2019 16:21:57 +0000 (16:21 +0000)]
Use AddressList in mutt_addr_parse_list

5 years agoUse AddressList in mutt_addrlist_dedupe
Pietro Cerutti [Mon, 13 May 2019 08:44:11 +0000 (08:44 +0000)]
Use AddressList in mutt_addrlist_dedupe

5 years agoAdd functions to convert to/from Address/AddressList
Pietro Cerutti [Fri, 10 May 2019 15:52:53 +0000 (15:52 +0000)]
Add functions to convert to/from Address/AddressList

5 years agoDefine an AddressList structure using TAILQ
Pietro Cerutti [Fri, 10 May 2019 15:51:13 +0000 (15:51 +0000)]
Define an AddressList structure using TAILQ

5 years agoAvoid redundant sort in entire-thread.
Andres Freund [Tue, 21 May 2019 23:50:54 +0000 (16:50 -0700)]
Avoid redundant sort in entire-thread.

918885f added, indirectly, a mutt_sort_headers() call to
nm_read_entire_thread() (via mutt_mailbox_changed() ->
ctx_mailbox_changed() -> ctx_update()), but didn't remove the sort
after nm_read_entire_thread() in mutt_index_menu().

Remove the now superfluous sort.

5 years agoentire-thread: determine current position before resorting.
Andres Freund [Tue, 21 May 2019 23:13:10 +0000 (16:13 -0700)]
entire-thread: determine current position before resorting.

Previously oldcur was determined after nm_read_entire_thread(),
leading to entire-thread unintentionally jumping to the first message
in the thread.

Before 918885f32db41 that used to work, because mutt_sort_headers()
wasn't called from within nm_read_entire_thread().

Fix by moving determination of pre nm_read_entire_thread() count a few
lines up. Also reuse existing oldcount variable, rather than
'oc' (which could also be oldcur).

Fixes: #1714
5 years agofix: reverse_name / alternates
Andres Freund [Tue, 21 May 2019 13:29:07 +0000 (14:29 +0100)]
fix: reverse_name / alternates

Fixes: #1581
5 years agomerge: minor tidying
Richard Russon [Thu, 16 May 2019 14:43:07 +0000 (15:43 +0100)]
merge: minor tidying

 * clang-format
 * readme: split out contributors
 * rename fd parameters
 * increase buffer sizes to avoid truncation
 * test: add missing #include guards
 * unify char buffer inititialisation
 * boolify: locals, params, args
 * rename mailbox functions
 * light tidying
 * don't check for empty config strings
 * rename struct Event and Mailbox.notify
 * move el_free() to email
 * tidy maildir_mbox_check()
 * config: rename listener to observer
 * tidy ternary operators
 * tidy char pointers
 * initialise pointers
 * tidy pointer definitions

5 years agotidy pointer definitions
Richard Russon [Thu, 16 May 2019 14:18:28 +0000 (15:18 +0100)]
tidy pointer definitions

Separate multiple variable definitions which differ in type, e.g.

  char buf[16], *p = NULL, **pp = NULL;

becomes

  char buf[16];
  char *p = NULL;
  char **pp = NULL;

5 years agoinitialise pointers
Richard Russon [Thu, 16 May 2019 13:53:31 +0000 (14:53 +0100)]
initialise pointers

5 years agotidy char pointers
Richard Russon [Wed, 15 May 2019 19:01:38 +0000 (20:01 +0100)]
tidy char pointers

Make char-pointer dereferencing more consistent.
Any functions that used both `*ptr` and `ptr[0]` notation have been tidied.

5 years agotidy ternary operators
Richard Russon [Wed, 15 May 2019 22:53:37 +0000 (23:53 +0100)]
tidy ternary operators

- insert ()s
- expand checks against 0 or '\0'

5 years agoconfig: rename listener to observer
Richard Russon [Wed, 15 May 2019 11:25:37 +0000 (12:25 +0100)]
config: rename listener to observer

This fits in with the GoF's subject/observer pattern.

5 years agotidy maildir_mbox_check()
Richard Russon [Wed, 15 May 2019 10:52:12 +0000 (11:52 +0100)]
tidy maildir_mbox_check()

Factor out a common pointer.

5 years agomove el_free() to email
Richard Russon [Wed, 15 May 2019 10:50:02 +0000 (11:50 +0100)]
move el_free() to email

This function will be used elsewhere, soon.

5 years agorename struct Event and Mailbox.notify
Richard Russon [Tue, 12 Mar 2019 16:01:15 +0000 (16:01 +0000)]
rename struct Event and Mailbox.notify

Rename things out of the way of future work.
These names will be used by a general notifications system.

5 years agodon't check for empty config strings
Richard Russon [Thu, 16 May 2019 11:55:40 +0000 (12:55 +0100)]
don't check for empty config strings

The config system stores empty strings as NULL.
Config variables must not be set directly, but using the config system
(this gives us validation and notifications).

5 years agolight tidying
Richard Russon [Tue, 30 Apr 2019 12:41:04 +0000 (13:41 +0100)]
light tidying

Lots of minor fixes, many inspired by cppcheck.

- reduce scope of variables
- return early
- NULL pointers after free
- fix typos
- correct retval type

5 years agorename mailbox functions
Richard Russon [Wed, 15 May 2019 23:31:46 +0000 (00:31 +0100)]
rename mailbox functions

Fix mailbox function naming for consistency

5 years agoboolify: locals, params, args
Richard Russon [Sun, 12 May 2019 22:40:08 +0000 (23:40 +0100)]
boolify: locals, params, args

5 years agounify char buffer inititialisation
Richard Russon [Wed, 15 May 2019 21:52:26 +0000 (22:52 +0100)]
unify char buffer inititialisation

For consistency, use the format:

  `char buf[16] = { 0 };`

5 years agotest: add missing #include guards
Richard Russon [Sun, 12 May 2019 22:44:19 +0000 (23:44 +0100)]
test: add missing #include guards

5 years agoincrease buffer sizes to avoid truncation
Richard Russon [Wed, 15 May 2019 20:24:41 +0000 (21:24 +0100)]
increase buffer sizes to avoid truncation

This is just to hide a compiler warning.

5 years agorename fd parameters
Richard Russon [Wed, 15 May 2019 19:26:29 +0000 (20:26 +0100)]
rename fd parameters

Rename parameters to match other functions.

5 years agoreadme: split out contributors
Richard Russon [Thu, 11 Apr 2019 10:38:08 +0000 (11:38 +0100)]
readme: split out contributors

5 years agoclang-format
Richard Russon [Thu, 16 May 2019 12:54:13 +0000 (13:54 +0100)]
clang-format

5 years agomerge: split up Buffer and the Pool
Richard Russon [Thu, 16 May 2019 11:14:49 +0000 (12:14 +0100)]
merge: split up Buffer and the Pool

 * split out pool
 * don't use pool in libraries
 * test: tidy config tests

5 years agotest: tidy config tests
Richard Russon [Thu, 16 May 2019 00:10:46 +0000 (01:10 +0100)]
test: tidy config tests

The config tests don't use the buffer pool any more.

5 years agodon't use pool in libraries
Richard Russon [Tue, 14 May 2019 18:09:51 +0000 (19:09 +0100)]
don't use pool in libraries