summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--activitypub.c42
-rw-r--r--snac.h8
2 files changed, 25 insertions, 25 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));
diff --git a/snac.h b/snac.h
index d57a333..2263656 100644
--- a/snac.h
+++ b/snac.h
@@ -196,16 +196,16 @@ int webfinger_get_handler(xs_dict *req, char *q_path,
196 196
197const char *default_avatar_base64(void); 197const char *default_avatar_base64(void);
198 198
199d_char *msg_admiration(snac *snac, char *object, char *type); 199xs_dict *msg_admiration(snac *snac, char *object, char *type);
200xs_dict *msg_create(snac *snac, const xs_dict *object); 200xs_dict *msg_create(snac *snac, const xs_dict *object);
201xs_dict *msg_follow(snac *snac, const char *actor); 201xs_dict *msg_follow(snac *snac, const char *actor);
202 202
203xs_dict *msg_note(snac *snac, const xs_str *content, const xs_val *rcpts, 203xs_dict *msg_note(snac *snac, const xs_str *content, const xs_val *rcpts,
204 xs_str *in_reply_to, xs_list *attach, int priv); 204 xs_str *in_reply_to, xs_list *attach, int priv);
205 205
206d_char *msg_undo(snac *snac, char *object); 206xs_dict *msg_undo(snac *snac, char *object);
207d_char *msg_delete(snac *snac, char *id); 207xs_dict *msg_delete(snac *snac, char *id);
208d_char *msg_actor(snac *snac); 208xs_dict *msg_actor(snac *snac);
209xs_dict *msg_update(snac *snac, xs_dict *object); 209xs_dict *msg_update(snac *snac, xs_dict *object);
210xs_dict *msg_ping(snac *user, const char *rcpt); 210xs_dict *msg_ping(snac *user, const char *rcpt);
211xs_dict *msg_pong(snac *user, const char *rcpt, const char *object); 211xs_dict *msg_pong(snac *user, const char *rcpt, const char *object);