mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 14:35:04 +00:00
Create the base message of msg_question() from msg_note().
This commit is contained in:
parent
7659362448
commit
be39b52064
3 changed files with 7 additions and 6 deletions
|
@ -932,15 +932,15 @@ xs_dict *msg_pong(snac *user, const char *rcpt, const char *object)
|
|||
}
|
||||
|
||||
|
||||
xs_dict *msg_question(snac *user, const char *content, const xs_list *opts, int multiple, int end_secs)
|
||||
xs_dict *msg_question(snac *user, const char *content, xs_list *attach,
|
||||
const xs_list *opts, int multiple, int end_secs)
|
||||
/* creates a Question message */
|
||||
{
|
||||
xs *ntid = tid(0);
|
||||
xs *id = xs_fmt("%s/q/%s", user->actor, ntid);
|
||||
xs_dict *msg = msg_base(user, "Question", id, NULL, "@now", NULL);
|
||||
xs_dict *msg = msg_note(user, content, NULL, NULL, attach, 0);
|
||||
|
||||
msg = xs_dict_append(msg, "content", content);
|
||||
msg = xs_dict_append(msg, "attributedTo", user->actor);
|
||||
msg = xs_dict_set(msg, "type", "Question");
|
||||
|
||||
xs *o = xs_list_new();
|
||||
xs_list *p = (xs_list *)opts;
|
||||
|
|
2
main.c
2
main.c
|
@ -256,7 +256,7 @@ int main(int argc, char *argv[])
|
|||
int end_secs = 5 * 60;
|
||||
xs *opts = xs_split(url, ";");
|
||||
|
||||
xs *msg = msg_question(&snac, "Poll", opts, 0, end_secs);
|
||||
xs *msg = msg_question(&snac, "Poll", NULL, opts, 0, end_secs);
|
||||
xs *c_msg = msg_create(&snac, msg);
|
||||
|
||||
if (dbglevel) {
|
||||
|
|
3
snac.h
3
snac.h
|
@ -208,7 +208,8 @@ d_char *msg_actor(snac *snac);
|
|||
xs_dict *msg_update(snac *snac, xs_dict *object);
|
||||
xs_dict *msg_ping(snac *user, const char *rcpt);
|
||||
xs_dict *msg_pong(snac *user, const char *rcpt, const char *object);
|
||||
xs_dict *msg_question(snac *user, const char *content, const xs_list *opts, int multiple, int end_secs);
|
||||
xs_dict *msg_question(snac *user, const char *content, xs_list *attach,
|
||||
const xs_list *opts, int multiple, int end_secs);
|
||||
|
||||
int activitypub_request(snac *snac, const char *url, xs_dict **data);
|
||||
int actor_request(snac *snac, const char *actor, xs_dict **data);
|
||||
|
|
Loading…
Reference in a new issue