diff options
author | Taeer Bar-Yam <taeer@necsi.edu> | 2019-01-23 16:44:29 -0500 |
---|---|---|
committer | Taeer Bar-Yam <taeer@necsi.edu> | 2019-01-23 16:44:29 -0500 |
commit | 96d344023866befd91b1bcbdbbfea4e5b21f7bf0 (patch) | |
tree | 9b3347e5958832495ba84ae89fc9b6a77b062b16 /src | |
parent | 28f33ca6afadf08fb07787e738f848d2a51afe96 (diff) |
Made it not check quoted text for attachment words
Diffstat (limited to 'src')
-rw-r--r-- | src/modes/edit_message.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/modes/edit_message.cc b/src/modes/edit_message.cc index 0c0d156..f5a4d50 100644 --- a/src/modes/edit_message.cc +++ b/src/modes/edit_message.cc @@ -1045,10 +1045,22 @@ namespace Astroid { if (attachments.empty () && !attachment_words.empty ()) { ustring bl = body.lowercase (); + /* strip quoted lines */ + ostringstream nonquoted; + stringstream sstr (bl); + while (sstr.good()) { + string line; + getline (sstr, line); + + if (line[0] != '>') + nonquoted << line << endl; + } + ustring nqb = ustring(nonquoted.str()); + if (any_of (attachment_words.begin (), attachment_words.end (), [&] (ustring w) { - return bl.find (w) != string::npos; + return nqb.find (w) != string::npos; })) { set_warning ("Attachments have been mentioned in the message, but none are attached, do you still want to send?"); |