More fixes to the crosslink "last" command
This commit is contained in:
parent
fc2b35a6ea
commit
795dae9aa2
|
@ -76,10 +76,6 @@ class FRNCrosslinkClient(FRNClient):
|
||||||
self.sendMultiLineTextMessage(client, cl)
|
self.sendMultiLineTextMessage(client, cl)
|
||||||
elif cmd == "last":
|
elif cmd == "last":
|
||||||
ml = []
|
ml = []
|
||||||
if talking is None:
|
|
||||||
ml.append("No client talking now")
|
|
||||||
else:
|
|
||||||
ml.append("%s is talking now" % talking.user.ON)
|
|
||||||
ml.append("Last active talkers (most recent first):")
|
ml.append("Last active talkers (most recent first):")
|
||||||
for n in lastMessages:
|
for n in lastMessages:
|
||||||
ml.append(n)
|
ml.append(n)
|
||||||
|
@ -97,21 +93,20 @@ class FRNCrosslinkClient(FRNClient):
|
||||||
global talking, lastMessages
|
global talking, lastMessages
|
||||||
self.txReq = False
|
self.txReq = False
|
||||||
self.txOk = False
|
self.txOk = False
|
||||||
if talking is not None: # FIXME: This is not the right place
|
|
||||||
l = talking.user.ON
|
|
||||||
if len(lastMessages) > 0:
|
|
||||||
if lastMessages[0] == l:
|
|
||||||
l = None
|
|
||||||
if l is not None:
|
|
||||||
lastMessages.insert(0, l)
|
|
||||||
lastMessages = lastMessages[:5]
|
|
||||||
talking = None
|
talking = None
|
||||||
self.stopTransmission()
|
self.stopTransmission()
|
||||||
|
|
||||||
def audioFrameReceived(self, from_id, frames):
|
def audioFrameReceived(self, from_id, frames):
|
||||||
global clients, talking
|
global clients, talking, lastMessages
|
||||||
if talking is None or talking == self:
|
if talking is None or talking == self:
|
||||||
talking = self
|
talking = self
|
||||||
|
talkingUser = self.clients[from_id-1]['on']
|
||||||
|
if len(lastMessages) > 0:
|
||||||
|
if lastMessages[0] == talkingUser:
|
||||||
|
talkingUser = None
|
||||||
|
if talkingUser is not None:
|
||||||
|
lastMessages.insert(0, talkingUser)
|
||||||
|
lastMessages = lastMessages[:5]
|
||||||
for _, _, _, factory in clients:
|
for _, _, _, factory in clients:
|
||||||
conn = factory.connection
|
conn = factory.connection
|
||||||
if conn != self:
|
if conn != self:
|
||||||
|
|
Loading…
Reference in New Issue