diff --git a/irc.py b/irc.py index 3f89ae9..e3f0d38 100644 --- a/irc.py +++ b/irc.py @@ -2,7 +2,7 @@ import logging import logging.config import socket import random -from time import time +import time from PyQt5 import QtCore, QtGui @@ -35,6 +35,7 @@ class PesterIRC(QtCore.QThread): self.mainwindow = window self.config = config self.registeredIRC = False + self.metadata_supported = False self.stopIRC = None self.NickServ = services.NickServ() self.ChanServ = services.ChanServ() @@ -331,7 +332,7 @@ class PesterIRC(QtCore.QThread): @QtCore.pyqtSlot() def pingServer(self): try: - self.cli.send("PING %s" % int(time())) + self.cli.send("PING %s" % int(time.time())) except socket.error as e: PchumLog.warning(e) self.setConnectionBroken() @@ -488,8 +489,6 @@ class PesterHandler(DefaultCommandHandler): #mychumhandle = self.mainwindow.profile().handle mymood = self.mainwindow.profile().mood.value() if not self.mainwindow.config.lowBandwidth(): - from time import sleep - sleep(0.5) # To prevent TLS from dying = 350: + try: + helpers.msg(self.client, "#pesterchum", chumglub) + except socket.error as e: + PchumLog.warning(e) + self.parent.setConnectionBroken() + chumglub = "GETMOOD " + chumglub += chandle + if chumglub != "GETMOOD ": + try: + helpers.msg(self.client, "#pesterchum", chumglub) + except socket.error as e: + PchumLog.warning(e) + self.parent.setConnectionBroken() + #def isOn(self, *chums): # isonNicks = ""