瀏覽代碼

Fixed bug in notify() (the poll id was not set).

default 3 年之前
父節點
當前提交
84152d67f5
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      activitypub.c
  2. 1 1
      html.c

+ 1 - 1
activitypub.c

@@ -602,7 +602,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
     if (strcmp(type, "Follow") == 0)
     if (strcmp(type, "Follow") == 0)
         objid = id;
         objid = id;
 
 
-    notify_add(snac, type, utype, actor, objid);
+    notify_add(snac, type, utype, actor, objid != NULL ? objid : id);
 }
 }
 
 
 
 

+ 1 - 1
html.c

@@ -1402,7 +1402,7 @@ xs_str *html_notifications(snac *snac)
         const char *utype = xs_dict_get(noti, "utype");
         const char *utype = xs_dict_get(noti, "utype");
         const char *id    = xs_dict_get(noti, "objid");
         const char *id    = xs_dict_get(noti, "objid");
 
 
-        if (!valid_status(object_get(id, &obj)))
+        if (xs_is_null(id) || !valid_status(object_get(id, &obj)))
             continue;
             continue;
 
 
         if (is_hidden(snac, id))
         if (is_hidden(snac, id))