Ver código fonte

Always store resolved account handles as metadata, even if they weren't verified.

grunfink 1 ano atrás
pai
commit
dfd246a0e9
1 arquivos alterados com 8 adições e 4 exclusões
  1. 8 4
      utils.c

+ 8 - 4
utils.c

@@ -497,6 +497,14 @@ void verify_links(snac *user)
             if (valid_status(webfinger_request(v, &wfinger, NULL)) && xs_is_string(wfinger)) {
                 ov = v;
                 v = wfinger;
+
+                /* store the alias */
+                if (user->links == NULL)
+                    user->links = xs_dict_new();
+
+                user->links = xs_dict_set(user->links, ov, v);
+
+                changed++;
             }
         }
 
@@ -575,10 +583,6 @@ void verify_links(snac *user)
 
                     user->links = xs_dict_set(user->links, v, verified_time);
 
-                    /* also add the original value if it was 'resolved' */
-                    if (xs_is_string(ov))
-                        user->links = xs_dict_set(user->links, ov, v);
-
                     vfied = 1;
                 }
                 else