mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Questions (polls) are now stored (but not yet shown).
This commit is contained in:
parent
adcdb28b6f
commit
a73636f671
1 changed files with 25 additions and 11 deletions
|
@ -1135,10 +1135,10 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (strcmp(type, "Create") == 0) {
|
if (strcmp(type, "Create") == 0) {
|
||||||
if (strcmp(utype, "Note") == 0) {
|
|
||||||
if (is_muted(snac, actor))
|
if (is_muted(snac, actor))
|
||||||
snac_log(snac, xs_fmt("ignored 'Note' from muted actor %s", actor));
|
snac_log(snac, xs_fmt("ignored 'Create' + '%s' from muted actor %s", utype, actor));
|
||||||
else {
|
|
||||||
|
if (strcmp(utype, "Note") == 0) {
|
||||||
char *id = xs_dict_get(object, "id");
|
char *id = xs_dict_get(object, "id");
|
||||||
char *in_reply_to = xs_dict_get(object, "inReplyTo");
|
char *in_reply_to = xs_dict_get(object, "inReplyTo");
|
||||||
xs *wrk = NULL;
|
xs *wrk = NULL;
|
||||||
|
@ -1150,6 +1150,12 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
|
||||||
do_notify = 1;
|
do_notify = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(utype, "Question") == 0) {
|
||||||
|
char *id = xs_dict_get(object, "id");
|
||||||
|
|
||||||
|
if (timeline_add(snac, id, object))
|
||||||
|
snac_log(snac, xs_fmt("new 'Question' %s %s", actor, id));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
snac_debug(snac, 1, xs_fmt("ignored 'Create' for object type '%s'", utype));
|
snac_debug(snac, 1, xs_fmt("ignored 'Create' for object type '%s'", utype));
|
||||||
|
@ -1222,6 +1228,14 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
|
||||||
|
|
||||||
snac_log(snac, xs_fmt("updated post %s", id));
|
snac_log(snac, xs_fmt("updated post %s", id));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(utype, "Question") == 0) {
|
||||||
|
char *id = xs_dict_get(object, "id");
|
||||||
|
|
||||||
|
object_add_ow(id, object);
|
||||||
|
|
||||||
|
snac_log(snac, xs_fmt("updated poll %s", id));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
snac_log(snac, xs_fmt("ignored 'Update' for object type '%s'", utype));
|
snac_log(snac, xs_fmt("ignored 'Update' for object type '%s'", utype));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue