From 52dcb27e1c19389bd833c93609910483ea3be549 Mon Sep 17 00:00:00 2001
From: Kitsune Ral <Kitsune-Ral@users.sf.net>
Date: Tue, 12 Feb 2019 07:55:15 +0900
Subject: RoomVersionsCapability: fix naming for 'default' parameter

The same word is used as a predicate in push_rule.yaml and
as a noun in capabilities.yaml; fortunately, GTAD gives some
means to distinguish the two.
---
 lib/csapi/capabilities.cpp | 2 +-
 lib/csapi/capabilities.h   | 2 +-
 lib/csapi/gtad.yaml        | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

(limited to 'lib')

diff --git a/lib/csapi/capabilities.cpp b/lib/csapi/capabilities.cpp
index a8e79f6b..bd92cf25 100644
--- a/lib/csapi/capabilities.cpp
+++ b/lib/csapi/capabilities.cpp
@@ -28,7 +28,7 @@ namespace QMatrixClient
     {
         static void fillFrom(const QJsonObject& jo, GetCapabilitiesJob::RoomVersionsCapability& result)
         {
-            fromJson(jo.value("default"_ls), result.isDefault);
+            fromJson(jo.value("default"_ls), result.defaultVersion);
             fromJson(jo.value("available"_ls), result.available);
         }
     };
diff --git a/lib/csapi/capabilities.h b/lib/csapi/capabilities.h
index e38483bc..40a2e6f7 100644
--- a/lib/csapi/capabilities.h
+++ b/lib/csapi/capabilities.h
@@ -33,7 +33,7 @@ namespace QMatrixClient
             struct RoomVersionsCapability
             {
                 /// The default room version the server is using for new rooms.
-                QString isDefault;
+                QString defaultVersion;
                 /// A detailed description of the room versions the server supports.
                 QHash<QString, QString> available;
             };
diff --git a/lib/csapi/gtad.yaml b/lib/csapi/gtad.yaml
index 21a59a5c..a44f803a 100644
--- a/lib/csapi/gtad.yaml
+++ b/lib/csapi/gtad.yaml
@@ -5,7 +5,8 @@ analyzer:
   identifiers:
     signed: signedData
     unsigned: unsignedData
-    default: isDefault
+    PushRule/default: isDefault
+    default: defaultVersion # getCapabilities/RoomVersionsCapability
     origin_server_ts: originServerTimestamp # Instead of originServerTs
     start: begin # Because start() is a method in BaseJob
     m.upload.size: uploadSize
-- 
cgit v1.2.3