diff --git a/frn/protocol/client.py b/frn/protocol/client.py index d269d5f..e401fe4 100644 --- a/frn/protocol/client.py +++ b/frn/protocol/client.py @@ -19,10 +19,15 @@ class FRNClient(BufferingLineReceiver, TimeoutMixin): def connectionMade(self): BufferingLineReceiver.connectionMade(self) self.user.VX = versions.client + self.serverdata = {} self.txq = Queue() self.setTimeout(25.0) self.login() + def connectionLost(self, reason): + self.serverdata = {} + BufferingLineReceiver.connectionLost(self, reason) + def ready(self): self.status = 'READY' self.msgbuffer = [] diff --git a/twisted/plugins/frncrosslink.py b/twisted/plugins/frncrosslink.py index 8563849..e2f6da4 100755 --- a/twisted/plugins/frncrosslink.py +++ b/twisted/plugins/frncrosslink.py @@ -78,17 +78,19 @@ class FRNCrosslinkClient(FRNClient): for _, _, _, factory in clients: conn = factory.connection if conn != self: - if conn.txOk: - conn.txReq = False - conn.sendAudioFrame(frames) - conn.busyTimer.reset(2.0) - else: - if not conn.txReq: - log.msg("Requesting TX for %s" % conn.user.ON) - conn.startTransmission() - conn.txReq = True - conn.busyTimer = self.reactor.callLater( - 5.0, conn.goIdle) + role = conn.serverdata.get('al', None) + if role in ['OK', 'ADMIN', 'OWNER']: + if conn.txOk: + conn.txReq = False + conn.sendAudioFrame(frames) + conn.busyTimer.reset(2.0) + else: + if not conn.txReq: + log.msg("Requesting TX for %s" % conn.user.ON) + conn.startTransmission() + conn.txReq = True + conn.busyTimer = self.reactor.callLater( + 5.0, conn.goIdle) self.pong() def loginResponse(self, info):