mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
msg_update() sends copies the 'to' and 'cc' fields in notes.
This commit is contained in:
parent
751211684f
commit
60f77b6cad
2 changed files with 10 additions and 3 deletions
|
@ -445,12 +445,19 @@ d_char *msg_accept(snac *snac, char *object, char *to)
|
|||
}
|
||||
|
||||
|
||||
d_char *msg_update(snac *snac, char *object)
|
||||
xs_dict *msg_update(snac *snac, xs_dict *object)
|
||||
/* creates an Update message */
|
||||
{
|
||||
d_char *msg = msg_base(snac, "Update", "@object", snac->actor, "@now", object);
|
||||
|
||||
msg = xs_dict_append(msg, "to", public_address);
|
||||
char *type = xs_dict_get(object, "type");
|
||||
|
||||
if (strcmp(type, "Note") == 0) {
|
||||
msg = xs_dict_append(msg, "to", xs_dict_get(object, "to"));
|
||||
msg = xs_dict_append(msg, "cc", xs_dict_get(object, "cc"));
|
||||
}
|
||||
else
|
||||
msg = xs_dict_append(msg, "to", public_address);
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
|
2
snac.h
2
snac.h
|
@ -183,7 +183,7 @@ xs_dict *msg_note(snac *snac, xs_str *content, xs_val *rcpts,
|
|||
d_char *msg_undo(snac *snac, char *object);
|
||||
d_char *msg_delete(snac *snac, char *id);
|
||||
d_char *msg_actor(snac *snac);
|
||||
d_char *msg_update(snac *snac, char *object);
|
||||
xs_dict *msg_update(snac *snac, xs_dict *object);
|
||||
|
||||
int activitypub_request(snac *snac, char *url, d_char **data);
|
||||
int actor_request(snac *snac, char *actor, d_char **data);
|
||||
|
|
Loading…
Reference in a new issue