Refresh screen when needed
This commit is contained in:
parent
bf130f1ede
commit
c136f34d9c
|
@ -266,6 +266,7 @@ class User(Peer):
|
||||||
while True:
|
while True:
|
||||||
self.refresh_history()
|
self.refresh_history()
|
||||||
self.refresh_input()
|
self.refresh_input()
|
||||||
|
self.refresh_emoji_pad()
|
||||||
if not self.squinnondation.no_emoji:
|
if not self.squinnondation.no_emoji:
|
||||||
self.refresh_emoji_pad()
|
self.refresh_emoji_pad()
|
||||||
try:
|
try:
|
||||||
|
@ -666,7 +667,6 @@ class User(Peer):
|
||||||
self.recent_messages.pop(key)
|
self.recent_messages.pop(key)
|
||||||
|
|
||||||
def main_inundation(self) -> None:
|
def main_inundation(self) -> None:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
The main inundation function.
|
The main inundation function.
|
||||||
"""
|
"""
|
||||||
|
@ -1047,6 +1047,7 @@ class Listener(Thread):
|
||||||
self.user.add_system_message("An error occurred while receiving a packet: {}".format(error))
|
self.user.add_system_message("An error occurred while receiving a packet: {}".format(error))
|
||||||
self.user.refresh_history()
|
self.user.refresh_history()
|
||||||
self.user.refresh_input()
|
self.user.refresh_input()
|
||||||
|
self.user.refresh_emoji_pad()
|
||||||
else:
|
else:
|
||||||
if peer.banned:
|
if peer.banned:
|
||||||
# Ignore banned peers
|
# Ignore banned peers
|
||||||
|
@ -1056,6 +1057,7 @@ class Listener(Thread):
|
||||||
tlv.handle(self.user, peer)
|
tlv.handle(self.user, peer)
|
||||||
self.user.refresh_history()
|
self.user.refresh_history()
|
||||||
self.user.refresh_input()
|
self.user.refresh_input()
|
||||||
|
self.user.refresh_emoji_pad()
|
||||||
|
|
||||||
class Multicastlistener(Thread):
|
class Multicastlistener(Thread):
|
||||||
"""
|
"""
|
||||||
|
@ -1074,6 +1076,7 @@ class Multicastlistener(Thread):
|
||||||
self.user.add_system_message("An error occurred while receiving a packet: {}".format(error))
|
self.user.add_system_message("An error occurred while receiving a packet: {}".format(error))
|
||||||
self.user.refresh_history()
|
self.user.refresh_history()
|
||||||
self.user.refresh_input()
|
self.user.refresh_input()
|
||||||
|
self.user.refresh_emoji_pad()
|
||||||
else:
|
else:
|
||||||
if peer.banned:
|
if peer.banned:
|
||||||
# Ignore banned peers
|
# Ignore banned peers
|
||||||
|
@ -1085,6 +1088,7 @@ class Multicastlistener(Thread):
|
||||||
tlv.handle(self.user, peer)
|
tlv.handle(self.user, peer)
|
||||||
self.user.refresh_history()
|
self.user.refresh_history()
|
||||||
self.user.refresh_input()
|
self.user.refresh_input()
|
||||||
|
self.user.refresh_emoji_pad()
|
||||||
|
|
||||||
|
|
||||||
class PeerManager(Thread):
|
class PeerManager(Thread):
|
||||||
|
@ -1133,7 +1137,11 @@ class PeerManager(Thread):
|
||||||
if time.time() - self.last_multicast > 60:
|
if time.time() - self.last_multicast > 60:
|
||||||
self.user.send_hello_multicast()
|
self.user.send_hello_multicast()
|
||||||
self.last_multicast = time.time()
|
self.last_multicast = time.time()
|
||||||
|
|
||||||
|
self.user.refresh_history()
|
||||||
|
self.user.refresh_input()
|
||||||
|
self.user.refresh_emoji_pad()
|
||||||
|
|
||||||
# Avoid infinite loops
|
# Avoid infinite loops
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
@ -1157,6 +1165,10 @@ class Inondator(Thread):
|
||||||
# inundate
|
# inundate
|
||||||
self.user.main_inundation()
|
self.user.main_inundation()
|
||||||
|
|
||||||
|
self.user.refresh_history()
|
||||||
|
self.user.refresh_input()
|
||||||
|
self.user.refresh_emoji_pad()
|
||||||
|
|
||||||
# Avoid infinite loops
|
# Avoid infinite loops
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
|
@ -76,8 +76,7 @@ class Squinnondation:
|
||||||
|
|
||||||
user.refresh_history()
|
user.refresh_history()
|
||||||
user.refresh_input()
|
user.refresh_input()
|
||||||
if not instance.no_emoji:
|
user.refresh_emoji_pad()
|
||||||
user.refresh_emoji_pad()
|
|
||||||
|
|
||||||
if instance.args.client_address and instance.args.client_port:
|
if instance.args.client_address and instance.args.client_port:
|
||||||
peer = Peer(address=instance.args.client_address, port=instance.args.client_port)
|
peer = Peer(address=instance.args.client_address, port=instance.args.client_port)
|
||||||
|
|
Loading…
Reference in New Issue