MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / emailNote

Method emailNote

cmdtools/cmdlinetool.cpp:130–147  ·  view source on GitHub ↗

Email a note via the command line.

Source from the content-addressed store, hash-verified

128
129// Email a note via the command line.
130int CmdLineTool::emailNote(StartupConfig config) {
131 // Look to see if another NixNote is running. If so, then we
132 // expect a response if the note was delete. Otherwise, we
133 // do it ourself.
134 bool useCrossMemory = true;
135 global.sharedMemory->unlock();
136 global.sharedMemory->detach();
137 if (!global.sharedMemory->attach()) {
138 useCrossMemory = false;
139 }
140 if (useCrossMemory) {
141 global.sharedMemory->write("EMAIL_NOTE:" + config.email->wrap());
142 } else {
143 global.db = new DatabaseConnection("nixnote"); // Startup the database
144 return config.email->sendEmail();
145 }
146 return 0;
147}
148
149
150// Delete a note via the command line

Callers 1

runMethod · 0.45

Calls 6

detachMethod · 0.80
attachMethod · 0.80
sendEmailMethod · 0.80
unlockMethod · 0.45
writeMethod · 0.45
wrapMethod · 0.45

Tested by

no test coverage detected