summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-11-08 00:53:31 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-11-08 00:53:31 +0100
commitb8b54735c7fe3bcdc2d3f739250b28e5facd9aef (patch)
treeba14e9670bd1e257aefcc3247faeac92ef02853a
parentc2798ba8dea84394c702ccf58cbda95a975f8605 (diff)
parent7d6c92ffc6af5ae738fc51b2f1454370e09a49fb (diff)
downloadpoezio-b8b54735c7fe3bcdc2d3f739250b28e5facd9aef.tar.gz
poezio-b8b54735c7fe3bcdc2d3f739250b28e5facd9aef.tar.bz2
poezio-b8b54735c7fe3bcdc2d3f739250b28e5facd9aef.tar.xz
poezio-b8b54735c7fe3bcdc2d3f739250b28e5facd9aef.zip
Merge remote-tracking branch 'origin/plugins' into plugins
-rw-r--r--plugins/day_change.py3
-rw-r--r--src/tabs.py13
2 files changed, 14 insertions, 2 deletions
diff --git a/plugins/day_change.py b/plugins/day_change.py
index cac69a75..14924684 100644
--- a/plugins/day_change.py
+++ b/plugins/day_change.py
@@ -24,8 +24,7 @@ class Plugin(BasePlugin):
if (isinstance(tab, tabs.MucTab) or
isinstance(tab, tabs.PrivateTab) or
isinstance(tab, tabs.ConversationTab)):
- room = tab.get_room()
- room.add_message(msg)
+ tab.add_message(msg)
self.core.refresh_window()
self.schedule_event()
diff --git a/src/tabs.py b/src/tabs.py
index d86b456c..e5df2e7d 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1408,6 +1408,7 @@ class RosterInfoTab(Tab):
self.commands['remove'] = (self.command_remove, _("Usage: /remove [jid]\nRemove: Use this command to remove the specified JID from your roster. This wil unsubscribe you from its presence, cancel its subscription to yours, and remove the item from your roster"), self.completion_remove)
self.commands['export'] = (self.command_export, _("Usage: /export [/path/to/file]\nExport: Use this command to export your contacts into /path/to/file if specified, or $HOME/poezio_contacts if not."), None)
self.commands['import'] = (self.command_import, _("Usage: /import [/path/to/file]\nImport: Use this command to import your contacts from /path/to/file if specified, or $HOME/poezio_contacts if not."), None)
+ self.commands['clear_infos'] = (self.command_clear_infos, _("Usage: /clear_infos\nClear Infos: Use this command to clear the info buffer."), None)
self.resize()
def resize(self):
@@ -1428,6 +1429,15 @@ class RosterInfoTab(Tab):
not self.input.help_message:
self.complete_commands(self.input)
+ def command_clear_infos(self, arg):
+ """
+ /clear_infos
+ """
+ self.core.information_buffer.messages = []
+ self.information_win.rebuild_everything(self.core.information_buffer)
+ self.core.information_win.rebuild_everything(self.core.information_buffer)
+ self.refresh()
+
def command_deny(self, args):
"""
Denies a JID from our roster
@@ -1993,6 +2003,9 @@ class ConversationTab(ChatTab):
if config.get('send_chat_states', 'true') == 'true':
self.send_chat_state('gone')
+ def add_message(self, txt, time=None, nickname=None, forced_user=None):
+ self._text_buffer.add_message(txt, time, nickname, None, None, forced_user)
+
class MucListTab(Tab):
"""
A tab listing rooms from a specific server, displaying various information,