diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b2c8ba..0b82bc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ - \# Contributing to aMQTT +# Contributing to aMQTT :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: diff --git a/amqtt/broker.py b/amqtt/broker.py index a1370a1..8642eb9 100644 --- a/amqtt/broker.py +++ b/amqtt/broker.py @@ -7,7 +7,7 @@ from functools import partial import logging import re import ssl -from typing import Any, ClassVar, TypeAlias +from typing import Any, ClassVar from transitions import Machine, MachineError import websockets.asyncio.server @@ -825,20 +825,6 @@ class Broker: self.logger.debug(f"Unsubscription on topic '{a_filter}' for client {format_client_message(session=session)}") return deleted - def matches(self, topic, a_filter): - if "#" not in a_filter and "+" not in a_filter: - # if filter doesn't contain wildcard, return exact match - return a_filter == topic - else: - # else use regex - match_pattern = re.compile( - re.escape(a_filter) - .replace("\\#", "?.*") - .replace("\\+", "[^/]*") - .lstrip("?") - ) - return match_pattern.fullmatch(topic) - async def _broadcast_loop(self) -> None: """Run the main loop to broadcast messages.""" running_tasks: deque[asyncio.Task[OutgoingApplicationMessage]] = self._tasks_queue