summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-27 14:07:36 +0200
committerdefault <nobody@localhost>2022-09-27 14:07:36 +0200
commit0b6540f503006aa3b4d004afbd9bbeeb35200b8a (patch)
tree37d6b7298d28274362d76a3db8ca5a145b839a43 /main.c
parentf516866f9ebcb24cc4b8db7573c59ff3a8bf3cfb (diff)
Notes can be posted WOW!.
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/main.c b/main.c
index 4b965b3..798f125 100644
--- a/main.c
+++ b/main.c
@@ -165,9 +165,9 @@ int main(int argc, char *argv[])
if (strcmp(cmd, "note") == 0) {
int status;
- xs *data = NULL;
xs *content = NULL;
- xs *f_content = NULL;
+ xs *msg = NULL;
+ xs *c_msg = NULL;
if (strcmp(url, "-") == 0) {
/* get the content from an editor */
@@ -189,9 +189,16 @@ int main(int argc, char *argv[])
else
content = xs_dup(url);
- not_really_markdown(content, &f_content);
+ msg = msg_note(&snac, content, NULL, NULL);
+
+ c_msg = msg_create(&snac, msg);
+
+ {
+ xs *j = xs_json_dumps_pp(c_msg, 4);
+ printf("%s\n", j);
+ }
- printf("%s\n", f_content);
+ post(&snac, c_msg);
return 0;
}