about summary refs log tree commit diff stats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/compose/send.go2
-rw-r--r--commands/msg/reply.go4
2 files changed, 6 insertions, 0 deletions
diff --git a/commands/compose/send.go b/commands/compose/send.go
index 36b9fd8..59ae5d0 100644
--- a/commands/compose/send.go
+++ b/commands/compose/send.go
@@ -244,6 +244,7 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error {
 				case *types.Done:
 					aerc.PushStatus("Message sent.", 10*time.Second)
 					r.Close()
+					composer.SetSent()
 					composer.Close()
 				case *types.Error:
 					aerc.PushError(" " + msg.Error.Error())
@@ -256,6 +257,7 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error {
 			w.Close()
 		} else {
 			aerc.PushStatus("Message sent.", 10*time.Second)
+			composer.SetSent()
 			composer.Close()
 		}
 	}()
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 8e0feef..28ce245 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -157,6 +157,10 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
 			tab.Content.Invalidate()
 		})
 
+		composer.OnClose(func(c *widgets.Composer) {
+			store.Answered([]uint32{msg.Uid}, c.Sent(), nil)
+		})
+
 		return nil
 	}
 
D; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
## print out a (global variable) string to stdout

var size : int = 14
var x : (array character) = "hello, world!"

fn main [
  call write 1/stdout, x, size
  call exit, 0
]

fn write fd : int, x : (address array byte), size : int [
  EBX <- copy fd
  ECX <- copy x
  EDX <- copy size
  EAX <- copy 4/write
  syscall
]

fn exit x : int [
  code/EBX <- copy x
  code/EAX <- copy 1/exit
  syscall
]