aboutsummaryrefslogtreecommitdiff
path: root/commands/compose
diff options
context:
space:
mode:
Diffstat (limited to 'commands/compose')
-rw-r--r--commands/compose/send-message.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/commands/compose/send-message.go b/commands/compose/send-message.go
new file mode 100644
index 0000000..b9fc9d2
--- /dev/null
+++ b/commands/compose/send-message.go
@@ -0,0 +1,29 @@
+package compose
+
+import (
+ "errors"
+ "os"
+
+ "git.sr.ht/~sircmpwn/aerc2/widgets"
+)
+
+func init() {
+ register("send-message", SendMessage)
+}
+
+func SendMessage(aerc *widgets.Aerc, args []string) error {
+ if len(args) > 1 {
+ return errors.New("Usage: send-message")
+ }
+ composer, _ := aerc.SelectedTab().(*widgets.Composer)
+ //config := composer.Config()
+ f, err := os.Create("/tmp/test.eml")
+ if err != nil {
+ panic(err)
+ }
+ _, err = composer.Message(f)
+ if err != nil {
+ panic(err)
+ }
+ return nil
+}