浏览代码

mastoapi: differentiate between 'mention' and 'status' notifications.

grunfink 1 周之前
父节点
当前提交
e4bcdcf231
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      mastoapi.c

+ 7 - 2
mastoapi.c

@@ -2395,8 +2395,13 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
                 if (strcmp(type, "Follow") == 0)
                     type = "follow";
                 else
-                if (strcmp(type, "Create") == 0)
-                    type = "mention";
+                if (strcmp(type, "Create") == 0) {
+                    const xs_dict *obj = xs_dict_get_path(noti, "msg.object");
+                    if (xs_is_dict(obj) && was_mentioned(&snac1, obj))
+                        type = "mention";
+                    else
+                        type = "status";
+                }
                 else
                 if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0)
                     type = "poll";