object_in_user() is a master function which calls slave functions fetch_user_bio...
authorArt Cancro <ajc@citadel.org>
Fri, 14 Sep 2018 15:37:17 +0000 (11:37 -0400)
committerArt Cancro <ajc@citadel.org>
Fri, 14 Sep 2018 15:37:17 +0000 (11:37 -0400)
webcit-ng/user_functions.c

index 7067ec753e9f6712f5a937677eae9f6b4c99f6f1..b3d360f000b539635acdefdc8ac2cb8caf7b0f46 100644 (file)
 #include "webcit.h"
 
 
+/*
+ * Fetch a user photo (avatar)
+ */
+void fetch_user_photo(struct http_transaction *h, struct ctdlsession *c)
+{
+       char username[1024];
+
+       extract_token(username, h->uri, 3, '/', sizeof username);
+
+       do_404(h);      // FIXME finish this
+}
+
+
+/*
+ * Fetch a user bio (profile)
+ */
+void fetch_user_bio(struct http_transaction *h, struct ctdlsession *c)
+{
+       char username[1024];
+
+       extract_token(username, h->uri, 3, '/', sizeof username);
+
+       do_404(h);      // FIXME finish this
+}
+
+
 /*
  * Client requested an object related to a user.
  */
@@ -26,8 +52,13 @@ void object_in_user(struct http_transaction *h, struct ctdlsession *c)
 
        extract_token(buf, h->uri, 4, '/', sizeof buf);
 
-       if (!strcasecmp(buf, "userpic")) {              // FIXME do this
-               do_404(h);
+       if (!strcasecmp(buf, "userpic")) {              // user photo (avatar)
+               fetch_user_photo(h, c);
+               return;
+       }
+
+       if (!strcasecmp(buf, "bio")) {                  // user bio (profile)
+               fetch_user_bio(h, c);
                return;
        }