summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar default2022-09-27 14:07:36 +0200
committerGravatar default2022-09-27 14:07:36 +0200
commit0b6540f503006aa3b4d004afbd9bbeeb35200b8a (patch)
tree37d6b7298d28274362d76a3db8ca5a145b839a43 /main.c
parentDisabled URL replacement by now because it's not infinite-loop-safe. (diff)
downloadsnac2-0b6540f503006aa3b4d004afbd9bbeeb35200b8a.tar.gz
snac2-0b6540f503006aa3b4d004afbd9bbeeb35200b8a.tar.xz
snac2-0b6540f503006aa3b4d004afbd9bbeeb35200b8a.zip
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[])
165 165
166 if (strcmp(cmd, "note") == 0) { 166 if (strcmp(cmd, "note") == 0) {
167 int status; 167 int status;
168 xs *data = NULL;
169 xs *content = NULL; 168 xs *content = NULL;
170 xs *f_content = NULL; 169 xs *msg = NULL;
170 xs *c_msg = NULL;
171 171
172 if (strcmp(url, "-") == 0) { 172 if (strcmp(url, "-") == 0) {
173 /* get the content from an editor */ 173 /* get the content from an editor */
@@ -189,9 +189,16 @@ int main(int argc, char *argv[])
189 else 189 else
190 content = xs_dup(url); 190 content = xs_dup(url);
191 191
192 not_really_markdown(content, &f_content); 192 msg = msg_note(&snac, content, NULL, NULL);
193
194 c_msg = msg_create(&snac, msg);
195
196 {
197 xs *j = xs_json_dumps_pp(c_msg, 4);
198 printf("%s\n", j);
199 }
193 200
194 printf("%s\n", f_content); 201 post(&snac, c_msg);
195 202
196 return 0; 203 return 0;
197 } 204 }