Skip to content

Commit

Permalink
#3930 remove unused legacy flags
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Sep 2, 2023
1 parent 7721123 commit 64e78b5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 25 deletions.
9 changes: 2 additions & 7 deletions xpra/client/mixins/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def __init__(self):
super().__init__()
self.client_supports_notifications = False
self.server_notifications = False
self.server_notifications_close = False
self.notifications_enabled = False
self.notifier = None
self.tray = None
Expand Down Expand Up @@ -60,20 +59,16 @@ def cleanup(self):


def parse_server_capabilities(self, c : typedict) -> bool:
self.server_notifications = c.boolget("notifications")
self.server_notifications_close = c.boolget("notifications.close")
self.server_notifications = "notifications" in c
self.notifications_enabled = self.client_supports_notifications
return True


def get_caps(self) -> dict[str,Any]:
enabled = self.client_supports_notifications
actions = bool(self.client_supports_notifications and self.notifier and self.notifier.handles_actions)
return {
"notifications" : {
"enabled" : enabled,
"close" : enabled,
"actions" : actions,
"enabled" : enabled,
},
}

Expand Down
9 changes: 3 additions & 6 deletions xpra/server/mixins/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ def get_server_features(self, _source=None) -> dict[str,Any]:
"receive" : self.remote_logging_receive,
"send" : self.remote_logging_send,
},
"remote-logging.receive" : self.remote_logging_receive,
"remote-logging.multi-line" : True,
"remote-logging.send" : self.remote_logging_send,
}


Expand All @@ -73,9 +70,9 @@ def add_logging_client(self, protocol) -> None:
n = len(self.logging_clients)
if protocol in self.logging_clients:
log.warn("Warning: logging already enabled for client %s", protocol)
else:
log.info("sending log output to %s", protocol)
self.logging_clients[protocol] = monotonic()
return
log.info("sending log output to %s", protocol)
self.logging_clients[protocol] = monotonic()
if n==0:
self.start_capturing_logging()

Expand Down
7 changes: 2 additions & 5 deletions xpra/server/mixins/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,9 @@ def get_info(self, _source=None)-> dict[str,Any]:

def get_server_features(self, _source=None)-> dict[str,Any]:
return {
"notifications" : {
"close" : self.notifications,
"actions" : self.notifications,
"notifications" : {
"enabled" : self.notifications,
},
"notifications.close" : self.notifications, #added in v2.3
"notifications.actions" : self.notifications, #added in v2.3
}

def parse_hello(self, ss, _caps, send_ui) -> None:
Expand Down
8 changes: 1 addition & 7 deletions xpra/server/source/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,12 @@ def is_needed(cls, caps : typedict) -> bool:

def init_state(self) -> None:
self.send_notifications : bool = False
self.send_notifications_actions : bool = False
self.notification_callbacks : dict[int,Callable] = {}

def parse_client_caps(self, c : typedict) -> None:
v = c.get("notifications")
if isinstance(v, dict):
c = typedict(v)
self.send_notifications = c.boolget("enabled")
self.send_notifications_actions = c.boolget("actions")
elif isinstance(v, bool):
self.send_notifications = c.boolget("notifications")
self.send_notifications_actions = c.boolget("notifications.actions")
self.send_notifications = typedict(v).boolget("enabled")
log("notifications=%s, actions=%s", self.send_notifications, self.send_notifications_actions)

def get_info(self) -> dict[str,Any]:
Expand Down

0 comments on commit 64e78b5

Please sign in to comment.