idle now works

This commit is contained in:
Yann Leboulanger 2005-04-17 11:49:39 +00:00
parent eb9eddce19
commit e3f53dd3c6
2 changed files with 6 additions and 6 deletions

View File

@ -491,8 +491,8 @@ class connection:
ptype = 'available' ptype = 'available'
if status == 'invisible': if status == 'invisible':
ptype = 'invisible' ptype = 'invisible'
prio = gajim.config.get_per('accounts', self.name, 'priority') prio = str(gajim.config.get_per('accounts', self.name, 'priority'))
self.connection.sendPresence(ptype, str(prio), status, msg, signed) self.connection.sendPresence(ptype, prio, status, msg, signed)
self.dispatch('STATUS', status) self.dispatch('STATUS', status)
#ask our VCard #ask our VCard
iq = common.jabber.Iq(type='get') iq = common.jabber.Iq(type='get')
@ -510,7 +510,7 @@ class connection:
ptype = 'available' ptype = 'available'
if status == 'invisible': if status == 'invisible':
ptype = 'invisible' ptype = 'invisible'
prio = gajim.config.get_per('accounts', self.name, 'priority') prio = str(gajim.config.get_per('accounts', self.name, 'priority'))
self.connection.sendPresence(ptype, prio, status, msg, signed) self.connection.sendPresence(ptype, prio, status, msg, signed)
self.dispatch('STATUS', status) self.dispatch('STATUS', status)

View File

@ -27,7 +27,7 @@ STATE_AWAKE = "awake"
SUPPORTED = 1 SUPPORTED = 1
try: try:
import idle import common.idle
except: except:
SUPPORTED = 0 SUPPORTED = 0
@ -39,7 +39,7 @@ class Sleepy:
self.interval2 = interval2 self.interval2 = interval2
self.state = STATE_AWAKE ## assume were awake to stake with self.state = STATE_AWAKE ## assume were awake to stake with
try: try:
idle.init() common.idle.init()
except: except:
SUPPORTED = 0 SUPPORTED = 0
self.state = STATE_UNKNOWN self.state = STATE_UNKNOWN
@ -47,7 +47,7 @@ class Sleepy:
def poll(self): def poll(self):
if not SUPPORTED: return 0 if not SUPPORTED: return 0
idleTime = idle.getIdleSec() idleTime = common.idle.getIdleSec()
if idleTime > self.interval2: if idleTime > self.interval2:
self.state = STATE_XAWAY self.state = STATE_XAWAY
elif idleTime > self.interval1: elif idleTime > self.interval1: