Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #357 from fischerling/allow_oneshots_with_tui
Browse files Browse the repository at this point in the history
Allow oneshots with tui
  • Loading branch information
skx committed Feb 24, 2019
2 parents 5112104 + c2b04a7 commit f09a5dd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
6 changes: 3 additions & 3 deletions global.config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1090,14 +1090,14 @@ end
--
-- Compose a new message.
--
function Message.compose ()
function Message.compose (to, subject)

-- Get some details
local to = Screen:get_address "To:"
local to = to or Screen:get_address "To:"
if to == nil or to == "" then
return
end
local subject = Screen:get_line "Subject:"
local subject = subject or Screen:get_line "Subject:"
if subject == nil or subject == "" then
subject = "No subject"
end
Expand Down
18 changes: 18 additions & 0 deletions sample.lua/compose.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--
--
-- Usage:
--
-- lumail2 --load-file ./compose.lua --to=email@address.tld --subj=
--

-- Iterate over the command-line arguments
--
local recipient, subject
for i, v in ipairs(ARGS) do
recipient = string.match(v, "--to=(.*)")
subject = string.match(v, "--subj=(.*)")
end

Message.compose(recipient, subject)
os.exit(0)

5 changes: 0 additions & 5 deletions src/screen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ void CScreen::update(std::string key_name, CConfigEntry *old)
*/
void CScreen::run_main_loop()
{
/*
* Now we're in our loop.
*/
m_running = true;

/*
* Get the lua-helper.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class CScreen : public Singleton<CScreen>, public Observer
/**
* Are we (still) in the event-loop?
*/
bool m_running;
bool m_running = true;

/**
* This map contains a mapping between a given mode-name and the
Expand Down

0 comments on commit f09a5dd

Please sign in to comment.