Fixed IDLE, stopped it from IDLING at NickServ and co.
This commit is contained in:
parent
6efac5cd07
commit
e8de29b1db
3 changed files with 26 additions and 17 deletions
|
@ -44,7 +44,6 @@ Features
|
||||||
* Add support for displaying more verbose information (e.g. Cease messages which tell you more than the abbreviation of who left)
|
* Add support for displaying more verbose information (e.g. Cease messages which tell you more than the abbreviation of who left)
|
||||||
* Make Pesterchum recognize conventional /mes so they aren't invisible
|
* Make Pesterchum recognize conventional /mes so they aren't invisible
|
||||||
* Fix NickServ auto-login things
|
* Fix NickServ auto-login things
|
||||||
* Fix memo autojoin
|
|
||||||
* Tell user when NickServ handles are going to expire
|
* Tell user when NickServ handles are going to expire
|
||||||
* Tell user when old handles have D/C'd? Offer autoghost support?!
|
* Tell user when old handles have D/C'd? Offer autoghost support?!
|
||||||
|
|
||||||
|
@ -73,6 +72,7 @@ Todo/Done
|
||||||
* Make CTRL+PGUP/PGDN switch memo/pester tabs
|
* Make CTRL+PGUP/PGDN switch memo/pester tabs
|
||||||
* Color tags are now posted as their shorter hexadecimal forms, if applicable (255,255,255 -> #FFFFFF, for example)
|
* Color tags are now posted as their shorter hexadecimal forms, if applicable (255,255,255 -> #FFFFFF, for example)
|
||||||
* Separate auto-idle and checkbox idle so they don't share a state (and make the first send set the timer for additional idle responses)
|
* Separate auto-idle and checkbox idle so they don't share a state (and make the first send set the timer for additional idle responses)
|
||||||
|
* Stop us from sending IDLE messages to NickServ
|
||||||
|
|
||||||
Debugging
|
Debugging
|
||||||
----
|
----
|
||||||
|
|
4
convo.py
4
convo.py
|
@ -405,7 +405,9 @@ class PesterText(QtGui.QTextEdit):
|
||||||
if chum is me:
|
if chum is me:
|
||||||
window.chatlog.log(parent.chum.handle, lexmsg)
|
window.chatlog.log(parent.chum.handle, lexmsg)
|
||||||
else:
|
else:
|
||||||
if (window.idler.auto or window.idler.manual) and parent.chumopen:
|
if ((window.idler.auto or window.idler.manual) and parent.chumopen
|
||||||
|
and chum.handle.lower() not in ('nickserv', 'chanserv',
|
||||||
|
'hostserv')):
|
||||||
idlethreshhold = 60
|
idlethreshhold = 60
|
||||||
if (not hasattr(self, 'lastmsg')) or \
|
if (not hasattr(self, 'lastmsg')) or \
|
||||||
datetime.now() - self.lastmsg > timedelta(0,idlethreshhold):
|
datetime.now() - self.lastmsg > timedelta(0,idlethreshhold):
|
||||||
|
|
|
@ -2053,32 +2053,36 @@ class PesterWindow(MovingWindow):
|
||||||
def checkIdle(self):
|
def checkIdle(self):
|
||||||
# TODO: Streamline this later, because ew.
|
# TODO: Streamline this later, because ew.
|
||||||
newpos = QtGui.QCursor.pos()
|
newpos = QtGui.QCursor.pos()
|
||||||
if self.idler.manual:
|
oldpos = self.idler.pos
|
||||||
# We're already idle - because the user said to be.
|
# Save the new position.
|
||||||
self.idler.pos = newpos
|
self.idler.pos = newpos
|
||||||
|
|
||||||
|
if self.idler.manual:
|
||||||
|
# We're already idle, because the user said to be.
|
||||||
|
self.idler.time = 0
|
||||||
|
return
|
||||||
|
elif self.idler.auto:
|
||||||
|
self.idler.time = 0
|
||||||
|
if newpos != oldpos:
|
||||||
|
# Cursor moved; unset idle.
|
||||||
|
self.idler.auto = False
|
||||||
return
|
return
|
||||||
|
|
||||||
if newpos == self.idler.pos:
|
if newpos != oldpos:
|
||||||
if not self.idler.auto:
|
# Our cursor has moved, which means we can't be idle.
|
||||||
# We're not already automatically idle.
|
|
||||||
# The cursor hasn't moved; we're that much closer to being idle.
|
|
||||||
self.idler.time += 1
|
|
||||||
else:
|
|
||||||
# The cursor moved; reset the idle timer.
|
|
||||||
self.idler.time = 0
|
self.idler.time = 0
|
||||||
|
return
|
||||||
|
|
||||||
|
# If we got here, WE ARE NOT IDLE, but may become so
|
||||||
|
self.idler.time += 1
|
||||||
if self.idler.time >= self.idler.threshold:
|
if self.idler.time >= self.idler.threshold:
|
||||||
# We've been idle for long enough to fall automatically idle.
|
# We've been idle for long enough to fall automatically idle.
|
||||||
self.idler.auto = True
|
self.idler.auto = True
|
||||||
# We don't need this anymore.
|
# We don't need this anymore.
|
||||||
self.idler.time = 0
|
self.idler.time = 0
|
||||||
|
# Send out the messages.
|
||||||
self._sendIdleMsgs()
|
self._sendIdleMsgs()
|
||||||
else:
|
|
||||||
# The mouse moved, and we were auto-away'd.
|
|
||||||
if self.idler.auto:
|
|
||||||
# ...so un-idle us.
|
|
||||||
self.idler.auto = False
|
|
||||||
self.idler.pos = newpos
|
|
||||||
def _sendIdleMsgs(self):
|
def _sendIdleMsgs(self):
|
||||||
# Tell everyone we're in a chat with that we just went idle.
|
# Tell everyone we're in a chat with that we just went idle.
|
||||||
sysColor = QtGui.QColor(self.theme["convo/systemMsgColor"])
|
sysColor = QtGui.QColor(self.theme["convo/systemMsgColor"])
|
||||||
|
@ -2090,6 +2094,9 @@ class PesterWindow(MovingWindow):
|
||||||
# might affect, but I've been using it for months and haven't
|
# might affect, but I've been using it for months and haven't
|
||||||
# noticed any issues....
|
# noticed any issues....
|
||||||
handle = convo.chum.handle
|
handle = convo.chum.handle
|
||||||
|
if handle.lower() in ("nickserv", "chanserv", "memoserv"):
|
||||||
|
# Don't send these idle messages.
|
||||||
|
continue
|
||||||
# karxi: Now we just use 'handle' instead of 'h'.
|
# karxi: Now we just use 'handle' instead of 'h'.
|
||||||
if convo.chumopen:
|
if convo.chumopen:
|
||||||
msg = self.profile().idlemsg(sysColor, verb)
|
msg = self.profile().idlemsg(sysColor, verb)
|
||||||
|
|
Loading…
Reference in a new issue