Privatize sticky and pool client variables
These have complicated semantics, and so are hopefully not depended on externally
This commit is contained in:
@@ -68,7 +68,7 @@ class Client(object):
|
|||||||
:type logging_level: int
|
:type logging_level: int
|
||||||
:raises: FBchatException on failed login
|
:raises: FBchatException on failed login
|
||||||
"""
|
"""
|
||||||
self.sticky, self.pool = (None, None)
|
self._sticky, self._pool = (None, None)
|
||||||
self._session = requests.session()
|
self._session = requests.session()
|
||||||
self.req_counter = 1
|
self.req_counter = 1
|
||||||
self.seq = "0"
|
self.seq = "0"
|
||||||
@@ -2382,8 +2382,8 @@ class Client(object):
|
|||||||
"partition": -2,
|
"partition": -2,
|
||||||
"cap": 0,
|
"cap": 0,
|
||||||
"uid": self._uid,
|
"uid": self._uid,
|
||||||
"sticky_token": self.sticky,
|
"sticky_token": self._sticky,
|
||||||
"sticky_pool": self.pool,
|
"sticky_pool": self._pool,
|
||||||
"viewer_uid": self._uid,
|
"viewer_uid": self._uid,
|
||||||
"state": "active",
|
"state": "active",
|
||||||
}
|
}
|
||||||
@@ -2393,8 +2393,8 @@ class Client(object):
|
|||||||
"""Call pull api with seq value to get message data."""
|
"""Call pull api with seq value to get message data."""
|
||||||
data = {
|
data = {
|
||||||
"msgs_recv": 0,
|
"msgs_recv": 0,
|
||||||
"sticky_token": self.sticky,
|
"sticky_token": self._sticky,
|
||||||
"sticky_pool": self.pool,
|
"sticky_pool": self._pool,
|
||||||
"clientid": self._client_id,
|
"clientid": self._client_id,
|
||||||
"state": "active" if self._markAlive else "offline",
|
"state": "active" if self._markAlive else "offline",
|
||||||
}
|
}
|
||||||
@@ -2951,8 +2951,8 @@ class Client(object):
|
|||||||
self.seq = content.get("seq", "0")
|
self.seq = content.get("seq", "0")
|
||||||
|
|
||||||
if "lb_info" in content:
|
if "lb_info" in content:
|
||||||
self.sticky = content["lb_info"]["sticky"]
|
self._sticky = content["lb_info"]["sticky"]
|
||||||
self.pool = content["lb_info"]["pool"]
|
self._pool = content["lb_info"]["pool"]
|
||||||
|
|
||||||
if "batches" in content:
|
if "batches" in content:
|
||||||
for batch in content["batches"]:
|
for batch in content["batches"]:
|
||||||
@@ -3098,7 +3098,7 @@ class Client(object):
|
|||||||
def stopListening(self):
|
def stopListening(self):
|
||||||
"""Cleans up the variables from startListening"""
|
"""Cleans up the variables from startListening"""
|
||||||
self.listening = False
|
self.listening = False
|
||||||
self.sticky, self.pool = (None, None)
|
self._sticky, self._pool = (None, None)
|
||||||
|
|
||||||
def listen(self, markAlive=None):
|
def listen(self, markAlive=None):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user