Add YowIqProtocolLayer to prevent connection from timing out
This commit is contained in:
parent
31bbab2ab1
commit
8b6a12c798
|
@ -32,6 +32,7 @@ from yowsup.layers import YowLayerEvent, YowParallelLayer
|
||||||
from yowsup.layers.interface import YowInterfaceLayer, ProtocolEntityCallback
|
from yowsup.layers.interface import YowInterfaceLayer, ProtocolEntityCallback
|
||||||
from yowsup.layers.auth import (YowCryptLayer, YowAuthenticationProtocolLayer,
|
from yowsup.layers.auth import (YowCryptLayer, YowAuthenticationProtocolLayer,
|
||||||
AuthError)
|
AuthError)
|
||||||
|
from yowsup.layers.protocol_iq import YowIqProtocolLayer
|
||||||
from yowsup.layers.coder import YowCoderLayer
|
from yowsup.layers.coder import YowCoderLayer
|
||||||
from yowsup.layers.network import YowNetworkLayer
|
from yowsup.layers.network import YowNetworkLayer
|
||||||
from yowsup.layers.protocol_messages import YowMessagesProtocolLayer
|
from yowsup.layers.protocol_messages import YowMessagesProtocolLayer
|
||||||
|
@ -46,7 +47,6 @@ from yowsup.layers.protocol_presence import *
|
||||||
from yowsup.layers.protocol_presence.protocolentities import *
|
from yowsup.layers.protocol_presence.protocolentities import *
|
||||||
from yowsup.layers.protocol_messages.protocolentities import TextMessageProtocolEntity
|
from yowsup.layers.protocol_messages.protocolentities import TextMessageProtocolEntity
|
||||||
from yowsup.layers.protocol_chatstate.protocolentities import *
|
from yowsup.layers.protocol_chatstate.protocolentities import *
|
||||||
|
|
||||||
from Spectrum2 import protocol_pb2
|
from Spectrum2 import protocol_pb2
|
||||||
|
|
||||||
from buddy import BuddyList
|
from buddy import BuddyList
|
||||||
|
@ -87,7 +87,7 @@ class Session():
|
||||||
YowMessagesProtocolLayer,
|
YowMessagesProtocolLayer,
|
||||||
YowReceiptProtocolLayer,
|
YowReceiptProtocolLayer,
|
||||||
YowAckProtocolLayer,
|
YowAckProtocolLayer,
|
||||||
YowMediaProtocolLayer)),
|
YowMediaProtocolLayer, YowIqProtocolLayer)),
|
||||||
YowCoderLayer,
|
YowCoderLayer,
|
||||||
YowCryptLayer,
|
YowCryptLayer,
|
||||||
YowStanzaRegulator,
|
YowStanzaRegulator,
|
||||||
|
@ -131,7 +131,7 @@ class Session():
|
||||||
self.logger.debug("Auth error -> user: %s; details: %s;",
|
self.logger.debug("Auth error -> user: %s; details: %s;",
|
||||||
self.user, e)
|
self.user, e)
|
||||||
try:
|
try:
|
||||||
self.stack.loop()
|
self.stack.loop(timeout=0.5, discrete=0.5)
|
||||||
except AuthError as e: # For some reason Yowsup throws an exception
|
except AuthError as e: # For some reason Yowsup throws an exception
|
||||||
self.logger.debug("Auth error -> user: %s; details: %s;",
|
self.logger.debug("Auth error -> user: %s; details: %s;",
|
||||||
self.user, e)
|
self.user, e)
|
||||||
|
|
Loading…
Reference in a new issue