Support exclusive conversations by default

This commit is contained in:
Lonami Exo
2018-10-12 22:17:07 +02:00
parent cf6686ff42
commit 0094eb391e
6 changed files with 50 additions and 5 deletions

View File

@@ -8,7 +8,8 @@ from threading import Thread
from .common import (
ReadCancelledError, TypeNotFoundError, InvalidChecksumError,
InvalidBufferError, SecurityError, CdnFileTamperedError, MultiError
InvalidBufferError, SecurityError, CdnFileTamperedError,
AlreadyInConversationError, MultiError
)
# This imports the base errors too, as they're imported there

View File

@@ -79,6 +79,17 @@ class CdnFileTamperedError(SecurityError):
)
class AlreadyInConversationError(Exception):
"""
Occurs when another exclusive conversation is opened in the same chat.
"""
def __init__(self):
super().__init__(
'Cannot open exclusive conversation in a '
'chat that already has one open conversation'
)
class MultiError(Exception):
"""Exception container for multiple `TLRequest`'s."""