merge ins fix

This commit is contained in:
Athena Funderburg
2026-07-06 21:55:00 +00:00
parent bd414d9ca1
commit 9513c7c785
+18
View File
@@ -236,6 +236,11 @@ class INSCtrl:
self.send_numeric(StatusCode.CircleActionSuccessful, ':CIRCLE {}'.format(ts)) self.send_numeric(StatusCode.CircleActionSuccessful, ':CIRCLE {}'.format(ts))
def _m_alert(self, ts: str, type: str, content: str = '', url: str = '', targets: str = 'all', icon: str = '') -> None: def _m_alert(self, ts: str, type: str, content: str = '', url: str = '', targets: str = 'all', icon: str = '') -> None:
if not self.authenticated:
self.send_numeric(Err.NotAuthenticated)
self.close()
return
def _quote_circumcision(s: str) -> str: def _quote_circumcision(s: str) -> str:
if not s or len(s) < 2: if not s or len(s) < 2:
return s return s
@@ -289,6 +294,11 @@ class INSCtrl:
def _m_user(self, ts: str, action: str, uuid: str, field: str = '', *args: str) -> None: def _m_user(self, ts: str, action: str, uuid: str, field: str = '', *args: str) -> None:
if not self.authenticated:
self.send_numeric(Err.NotAuthenticated)
self.close()
return
def _parse_value_for_column(col, value_str): def _parse_value_for_column(col, value_str):
py_type = getattr(col.type, 'python_type', None) py_type = getattr(col.type, 'python_type', None)
if py_type is not None: if py_type is not None:
@@ -675,6 +685,10 @@ class INSCtrl:
def _m_allthesessions(self, ts: str, email_filter: str = '') -> None: def _m_allthesessions(self, ts: str, email_filter: str = '') -> None:
# TODO: make this a payload command # TODO: make this a payload command
if not self.authenticated:
self.send_numeric(Err.NotAuthenticated)
self.close()
return
sessions_info = [] sessions_info = []
for bs in self.backend._sc.iter_sessions(): for bs in self.backend._sc.iter_sessions():
if email_filter and bs.user.email != email_filter: if email_filter and bs.user.email != email_filter:
@@ -684,6 +698,10 @@ class INSCtrl:
self.send_reply('ALLTHESESSIONS', ts, *sessions_info) self.send_reply('ALLTHESESSIONS', ts, *sessions_info)
def _m_session(self, ts: str, sess_id: str, method: str) -> None: def _m_session(self, ts: str, sess_id: str, method: str) -> None:
if not self.authenticated:
self.send_numeric(Err.NotAuthenticated)
self.close()
return
target = None target = None
for bs in self.backend._sc.iter_sessions(): for bs in self.backend._sc.iter_sessions():
if str(id(bs)) == sess_id: if str(id(bs)) == sess_id: