summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core.py b/src/core.py
index f92e2730..afdd1c14 100644
--- a/src/core.py
+++ b/src/core.py
@@ -8,7 +8,6 @@
from gettext import gettext as _
import os
-import re
import sys
import time
import curses
@@ -44,8 +43,7 @@ from plugin_manager import PluginManager
from data_forms import DataFormsTab
from config import config, options
from logger import logger
-from user import User
-from roster import Roster, RosterGroup, roster
+from roster import roster
from contact import Contact, Resource
from text_buffer import TextBuffer
from keyboard import read_char
@@ -381,6 +379,8 @@ class Core(object):
if not contact.get_highest_priority_resource(): # No resource left: that was the last one
self.add_information_message_to_conversation_tab(jid.bare, '\x195}%s is \x191}offline' % (jid.bare))
self.information('\x193}%s \x195}is \x191}offline' % (resource.get_jid().bare), "Roster")
+ if isinstance(self.current_tab(), tabs.RosterInfoTab):
+ self.refresh_window()
def on_got_online(self, presence):
jid = presence['from']
@@ -403,9 +403,14 @@ class Core(object):
# No connected resource yet: the user's just connecting
if time.time() - self.connection_time > 12:
# We do not display messages if we recently logged in
- self.information("\x193}%s \x195}is \x194}online\x195} (\x190}%s\x195})" % (resource.get_jid().bare, status), "Roster")
+ if status_message:
+ self.information("\x193}%s \x195}is \x194}online\x195} (\x19o%s\x195})" % (resource.get_jid().bare, status_message), "Roster")
+ else:
+ self.information("\x193}%s \x195}is \x194}online\x195}" % resource.get_jid().bare, "Roster")
self.add_information_message_to_conversation_tab(jid.bare, '\x195}%s is \x194}online' % (jid.bare))
contact.add_resource(resource)
+ if isinstance(self.current_tab(), tabs.RosterInfoTab):
+ self.refresh_window()
def add_information_message_to_conversation_tab(self, jid, msg):
"""
@@ -1219,7 +1224,9 @@ class Core(object):
self.xmpp.plugin['xep_0030'].get_items(jid=server, block=False, callback=list_tab.on_muc_list_item_received)
def command_theme(self, arg):
- theming.reload_theme()
+ warning = theming.reload_theme()
+ if warning:
+ self.information(warning, 'Warning')
self.refresh_window()
def command_win(self, arg):
@@ -1286,7 +1293,6 @@ class Core(object):
the_input.auto_completion(items, '')
else:
# we are writing the server: complete the server
- serv = jid.server
serv_list = []
for tab in self.tabs:
if isinstance(tab, tabs.MucTab):
@@ -1295,7 +1301,6 @@ class Core(object):
return True
def completion_list(self, the_input):
- txt = the_input.get_text()
muc_serv_list = []
for tab in self.tabs: # TODO, also from an history
if isinstance(tab, tabs.MucTab) and\