summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2020-02-28Add IndentionHelper for handlebars templatingMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-02-28Make error output in handlebars render error more verboseMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-02-21Add test whether Store::is_borrowed() works as expectedMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Fix: Use module path when getting mail instead of using plain MessageId ↵Matthias Beyer
object in String representation Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Merge branch 'libimagmail/neighbors' into masterMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Add MailStore::thread_root_of()Matthias Beyer
This patch adds a function to find the root node of a mailthread (as in In-Reply-To header). Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Add Mail::get_thread() for getting all mails in the same thread as this mailMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Merge branch 'libimagstore/is-borrowed' into masterMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Add Store::is_borrowed(StoreId)Matthias Beyer
Add a function to Store to check whether a StoreId is borrowed. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Merge branch 'libimagmail/flags' into masterMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Add helper functions to check whether a mail is passed, replied,...Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Add Mail::{get_,neighbors}()Matthias Beyer
This patch adds functions to get the direct neighbors of a mail. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Add MailIterator for iterating over entries that are mailsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Add function to get char representation of flagMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Add function to get flagsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-03Add flags module for flags representation as strong typesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-02Rewrite Hasher::hash() for MailHasherMatthias Beyer
Because message ids should be unique, we consider this to be safe. This should seems to be the best practice. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-02Fix: Do not assume UTF8 encoding of data to hashMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-02Optimization: Get the Message-Id from the header, if it is thereMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-02Use MessageId type where applicableMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-02Impl Display for MessageIdMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-02Add more impls on MessageId typeMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-02Fix: Set isflag when creating a mail in the storeMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-02Fix: Do not assume a mail file to be valid UTF8Matthias Beyer
We did assume that the file contained valid UTF8 when reading to `String`. Now we read to a byte buffer, which removes the (wrong) assumtion. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-02Store::retrieve_mail_from_path() should have a flag to force making a ref ↵Matthias Beyer
out of the entry Because if the entry already exists, we might override the ref anyways. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-01-01Update copyright years to 2015-2020Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-25Fix: Remove Box::leak() call in runtime application abstractionMatthias Beyer
This patch removes the leakage in the runtime application abstraction. Also fix formatting. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-23Remove unused lifetimeMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-23Remove unnecessary clone().to_string() callsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-23Remove unnecessary return keywordMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-23Remove unnecessary clone() callMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-23Remove main() in doctestMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-23Remove unnecessary clone() callMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-23Remove DebugResult and DebugOption helpersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-23Replace map_dbg() and map_dbg_str() with context() and inspect() callsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-23Replace map_dbg_err() calls with context() callsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-22Fix: Ignore broken pipe when reporting idsMatthias Beyer
This fixes a bug where a broken pipe in Runtime::report_touched() resulted in an Err(_) raised up to main() which then reported this. But as report_touched() should ignore a broken pipe (because the program will exit anyways shortly after the call), we can safely ignore this error. This also results in `ExitCode` removed from the function signature, which pushes us forward to the removal of custom error-handling implementations! Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-22Remove let binding for unit valueMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-21Remove unit-let-bindingMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-21Impl FromStr instead of own functionMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-21Remove unit-let-bindingMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-08Add functions to get by id and remove with FileLockEntryMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-08Add "is"-flag setting when creating bookmarkMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-12-08Remove old implementation, define interface for new implementationMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-11-11Fix: a tag can contain ascii digitsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-11-11Make tag-checking error message more explicit about what is wrongMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-11-09Add builder for todo entriesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-11-09Reimplement libimagtodoMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-11-09Remove old implementationMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-11-09Add Runtime::input_is_pipe()Matthias Beyer
We need this because we might want to check whether we can get the STDIN handle from the runtime or not. In some (rare) cases, the runtime "thinks" that STDIN is a stream of IDs, but it is not. So the client can check whether stdin is a pipe (thus, whether Runtime thinks that there's a stream of IDs) and easily work around that by taking ::std::io::stdin() itself. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>