Remove default layers, The logging layer causes problems

This commit is contained in:
moyamo 2015-06-21 16:59:09 +02:00
parent ebed803984
commit 31bbab2ab1

View file

@ -27,7 +27,7 @@ import logging
import urllib import urllib
import time import time
from yowsup.stacks import YowStack, YowStackBuilder from yowsup.stacks import YowStack
from yowsup.layers import YowLayerEvent, YowParallelLayer 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,
@ -82,10 +82,18 @@ class Session():
self.bot = Bot(self) self.bot = Bot(self)
env.CURRENT_ENV = env.S40YowsupEnv() env.CURRENT_ENV = env.S40YowsupEnv()
self.stack = YowStackBuilder()\ layers = (SpectrumLayer,
.pushDefaultLayers(False)\ YowParallelLayer((YowAuthenticationProtocolLayer,
.push(SpectrumLayer)\ YowMessagesProtocolLayer,
.build() YowReceiptProtocolLayer,
YowAckProtocolLayer,
YowMediaProtocolLayer)),
YowCoderLayer,
YowCryptLayer,
YowStanzaRegulator,
YowNetworkLayer
)
self.stack = YowStack(layers)
self.stack.broadcastEvent( self.stack.broadcastEvent(
YowLayerEvent(SpectrumLayer.EVENT_START, YowLayerEvent(SpectrumLayer.EVENT_START,
backend = self.backend, backend = self.backend,