Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mrDoctorWho/vk4xmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Smith <mrdoctorwho@helldev.net>2019-03-15 18:13:20 +0300
committerJohn Smith <mrdoctorwho@helldev.net>2019-03-15 18:13:29 +0300
commit98a1194833b925fdbdf5e3ead9edf9b11504934f (patch)
treec8445113e9e48bc63d6527a3e1c976df88dfa278
parent2e18189168e4be178c1d97d900d1346b55546aca (diff)
add disclamer; fix transport trying to iterate over a None
-rw-r--r--gateway.py27
-rw-r--r--library/longpoll.py4
2 files changed, 18 insertions, 13 deletions
diff --git a/gateway.py b/gateway.py
index 16d12e5..3dee4f0 100644
--- a/gateway.py
+++ b/gateway.py
@@ -1,13 +1,16 @@
#!/usr/bin/env python2
# coding: utf-8
-# vk4xmpp gateway, v3.0
+# vk4xmpp gateway, v3.6
# © simpleApps, 2013 — 2018.
# Program published under the MIT license.
+# Disclamer: be aware that this program's code may hurt your eyes or feelings.
+# You were warned.
+
__author__ = "mrDoctorWho <mrdoctorwho@gmail.com>"
__license__ = "MIT"
-__version__ = "3.5"
+__version__ = "3.6"
import hashlib
import logging
@@ -320,6 +323,7 @@ class VK(object):
return True
# TODO: move it the hell outta here
+ # wtf it's still doing here?
def makePoll(self):
"""
Returns:
@@ -502,15 +506,16 @@ class VK(object):
{"users": users,
"start_message_id": mid,
"count": count})
- for message in response:
- # skipping count-only reponses
- if len(message) > 1:
- if isinstance(message, list):
- first = message[0]
- # removing the unread count
- if isinstance(first, (int, long)):
- message.remove(first)
- messages.extend(message)
+ if response:
+ for message in response:
+ # skipping count-only reponses
+ if len(message) > 1:
+ if isinstance(message, list):
+ first = message[0]
+ # removing the unread count
+ if isinstance(first, (int, long)):
+ message.remove(first)
+ messages.extend(message)
else:
# not sure if that's okay
# VK is totally unpredictable now
diff --git a/library/longpoll.py b/library/longpoll.py
index 6bc1c65..fb3e814 100644
--- a/library/longpoll.py
+++ b/library/longpoll.py
@@ -209,8 +209,8 @@ class Poll(object):
else:
try:
cls.__add(some_user)
- except api.LongPollError:
- logger.error("longpoll: failed to make poll (jid: %s)", some_user.source)
+ except api.LongPollError as e:
+ logger.debug("longpoll: failed to make poll: %s (jid: %s)", e.message, some_user.source)
cls.__addToBuffer(some_user)
except Exception:
crashLog("poll.add")