summaryrefslogtreecommitdiff
path: root/server/src/journalwriter.cc
diff options
context:
space:
mode:
authordeva <deva>2010-05-27 09:45:12 +0000
committerdeva <deva>2010-05-27 09:45:12 +0000
commitf92dd279a1e26dad7507d5d6944567c23834d440 (patch)
tree59dbd43d60937c6b3eaa82a36de8859a209e8163 /server/src/journalwriter.cc
parent73934812611cc7120175e26761d71fae9233c1e8 (diff)
A lot of session handling. A lot of new unit tests. Add of a more structured commit/discard handling. Fix of some wierd line break bugs in journalwriter
Diffstat (limited to 'server/src/journalwriter.cc')
-rw-r--r--server/src/journalwriter.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/server/src/journalwriter.cc b/server/src/journalwriter.cc
index c73a841..4b2b4be 100644
--- a/server/src/journalwriter.cc
+++ b/server/src/journalwriter.cc
@@ -187,7 +187,9 @@ void JournalWriter::addEntry(Transaction &transaction, Commit &commit,
PRACRO_DEBUG(journal, "addEntry: template(%s)\n", templ->attributes["name"].c_str());
- // Add the template resume as the header (ie. first entry) of the journal entry.
+#if 0 // this feature is no longer nessecary...
+ // Add the template resume as the header (ie. first entry)
+ // of the journal entry.
if(entrylist.size() == 0 && templ->attributes["name"] != "") {
std::string template_resume = templ->attributes["resume"];
@@ -200,16 +202,23 @@ void JournalWriter::addEntry(Transaction &transaction, Commit &commit,
entrylist[-1] = re; // Make sure it comes first.
}
}
+#endif
- // Test if the username or the cpr has changed... if so, commit and clear the list.
+ // Test if the username or the cpr has changed...
+ // if so, commit and clear the list.
if(currentuser != transaction.user || currentcpr != transaction.cpr) {
this->commit();
entrylist.clear();
}
+ addEntry(resume, commit.macro, index);
+}
+
+void JournalWriter::addEntry(std::string resume, std::string macro, int index)
+{
// Strip trailing whitespace, and add newlines.
std::string r = stripTrailingWhitepace(addNewlines(resume, 60));
- std::string m = commit.macro;
+ std::string m = macro;
ResumeEntry re;
re.resume = r;