Преглед на файлове

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";