Browse Source

Adjust get_inbox to allow limit=0 requests

Tulir Asokan 2 years ago
parent
commit
e5dc1b6afc
2 changed files with 5 additions and 5 deletions
  1. 1 1
      mauigpapi/http/thread.py
  2. 4 4
      mauigpapi/types/direct_inbox.py

+ 1 - 1
mauigpapi/http/thread.py

@@ -37,7 +37,7 @@ class ThreadAPI(BaseAndroidAPI):
         self,
         self,
         cursor: str | None = None,
         cursor: str | None = None,
         seq_id: str | None = None,
         seq_id: str | None = None,
-        message_limit: int = 10,
+        message_limit: int | None = 10,
         limit: int = 20,
         limit: int = 20,
         pending: bool = False,
         pending: bool = False,
         spam: bool = False,
         spam: bool = False,

+ 4 - 4
mauigpapi/types/direct_inbox.py

@@ -44,12 +44,12 @@ class DMInbox(SerializableAttrs):
 @dataclass
 @dataclass
 class DMInboxResponse(SerializableAttrs):
 class DMInboxResponse(SerializableAttrs):
     status: str
     status: str
-    seq_id: int
-    snapshot_at_ms: int
     pending_requests_total: int
     pending_requests_total: int
     has_pending_top_requests: bool
     has_pending_top_requests: bool
-    viewer: ThreadUser
-    inbox: DMInbox
+    seq_id: Optional[int] = None
+    snapshot_at_ms: Optional[int] = None
+    viewer: Optional[ThreadUser] = None
+    inbox: Optional[DMInbox] = None
     # TODO type
     # TODO type
     most_recent_inviter: Any = None
     most_recent_inviter: Any = None