summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2023-06-04 10:34:39 +0200
committerGravatar default2023-06-04 10:34:39 +0200
commit3a8005f9bf768e17a086f033c90661c9d8c8f8e5 (patch)
tree3b7f7a1fae85874ba91e30130f8f526a0d1641e4 /activitypub.c
parentVersion 2.34 RELEASED. (diff)
downloadsnac2-3a8005f9bf768e17a086f033c90661c9d8c8f8e5.tar.gz
snac2-3a8005f9bf768e17a086f033c90661c9d8c8f8e5.tar.xz
snac2-3a8005f9bf768e17a086f033c90661c9d8c8f8e5.zip
Updated some data types.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/activitypub.c b/activitypub.c
index a25a46c..d8e01e8 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -669,10 +669,10 @@ xs_dict *msg_base(snac *snac, const char *type, const char *id,
669} 669}
670 670
671 671
672d_char *msg_collection(snac *snac, char *id) 672xs_dict *msg_collection(snac *snac, char *id)
673/* creates an empty OrderedCollection message */ 673/* creates an empty OrderedCollection message */
674{ 674{
675 d_char *msg = msg_base(snac, "OrderedCollection", id, NULL, NULL, NULL); 675 xs_dict *msg = msg_base(snac, "OrderedCollection", id, NULL, NULL, NULL);
676 xs *ol = xs_list_new(); 676 xs *ol = xs_list_new();
677 xs *nz = xs_number_new(0); 677 xs *nz = xs_number_new(0);
678 678
@@ -684,10 +684,10 @@ d_char *msg_collection(snac *snac, char *id)
684} 684}
685 685
686 686
687d_char *msg_accept(snac *snac, char *object, char *to) 687xs_dict *msg_accept(snac *snac, char *object, char *to)
688/* creates an Accept message (as a response to a Follow) */ 688/* creates an Accept message (as a response to a Follow) */
689{ 689{
690 d_char *msg = msg_base(snac, "Accept", "@dummy", snac->actor, NULL, object); 690 xs_dict *msg = msg_base(snac, "Accept", "@dummy", snac->actor, NULL, object);
691 691
692 msg = xs_dict_append(msg, "to", to); 692 msg = xs_dict_append(msg, "to", to);
693 693
@@ -723,12 +723,12 @@ xs_dict *msg_update(snac *snac, xs_dict *object)
723} 723}
724 724
725 725
726d_char *msg_admiration(snac *snac, char *object, char *type) 726xs_dict *msg_admiration(snac *snac, char *object, char *type)
727/* creates a Like or Announce message */ 727/* creates a Like or Announce message */
728{ 728{
729 xs *a_msg = NULL; 729 xs *a_msg = NULL;
730 d_char *msg = NULL; 730 xs_dict *msg = NULL;
731 xs *wrk = NULL; 731 xs *wrk = NULL;
732 732
733 /* call the object */ 733 /* call the object */
734 timeline_request(snac, &object, &wrk); 734 timeline_request(snac, &object, &wrk);
@@ -752,16 +752,16 @@ d_char *msg_admiration(snac *snac, char *object, char *type)
752} 752}
753 753
754 754
755d_char *msg_actor(snac *snac) 755xs_dict *msg_actor(snac *snac)
756/* create a Person message for this actor */ 756/* create a Person message for this actor */
757{ 757{
758 xs *ctxt = xs_list_new(); 758 xs *ctxt = xs_list_new();
759 xs *icon = xs_dict_new(); 759 xs *icon = xs_dict_new();
760 xs *keys = xs_dict_new(); 760 xs *keys = xs_dict_new();
761 xs *avtr = NULL; 761 xs *avtr = NULL;
762 xs *kid = NULL; 762 xs *kid = NULL;
763 xs *f_bio = NULL; 763 xs *f_bio = NULL;
764 d_char *msg = msg_base(snac, "Person", snac->actor, NULL, NULL, NULL); 764 xs_dict *msg = msg_base(snac, "Person", snac->actor, NULL, NULL, NULL);
765 char *p; 765 char *p;
766 int n; 766 int n;
767 767
@@ -828,10 +828,10 @@ xs_dict *msg_create(snac *snac, const xs_dict *object)
828} 828}
829 829
830 830
831d_char *msg_undo(snac *snac, char *object) 831xs_dict *msg_undo(snac *snac, char *object)
832/* creates an 'Undo' message */ 832/* creates an 'Undo' message */
833{ 833{
834 d_char *msg = msg_base(snac, "Undo", "@object", snac->actor, "@now", object); 834 xs_dict *msg = msg_base(snac, "Undo", "@object", snac->actor, "@now", object);
835 835
836 msg = xs_dict_append(msg, "to", xs_dict_get(object, "object")); 836 msg = xs_dict_append(msg, "to", xs_dict_get(object, "object"));
837 837
@@ -839,11 +839,11 @@ d_char *msg_undo(snac *snac, char *object)
839} 839}
840 840
841 841
842d_char *msg_delete(snac *snac, char *id) 842xs_dict *msg_delete(snac *snac, char *id)
843/* creates a 'Delete' + 'Tombstone' for a local entry */ 843/* creates a 'Delete' + 'Tombstone' for a local entry */
844{ 844{
845 xs *tomb = xs_dict_new(); 845 xs *tomb = xs_dict_new();
846 d_char *msg = NULL; 846 xs_dict *msg = NULL;
847 847
848 /* sculpt the tombstone */ 848 /* sculpt the tombstone */
849 tomb = xs_dict_append(tomb, "type", "Tombstone"); 849 tomb = xs_dict_append(tomb, "type", "Tombstone");
@@ -863,7 +863,7 @@ xs_dict *msg_follow(snac *snac, const char *q)
863{ 863{
864 xs *actor_o = NULL; 864 xs *actor_o = NULL;
865 xs *actor = NULL; 865 xs *actor = NULL;
866 d_char *msg = NULL; 866 xs_dict *msg = NULL;
867 int status; 867 int status;
868 868
869 xs *url_or_uid = xs_strip_i(xs_str_new(q)); 869 xs *url_or_uid = xs_strip_i(xs_str_new(q));