changeset 87644975736c in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=87644975736c
description: * first draft of ArchivingPreferences (for XEP-0136)
diffstat:
src/common/message_archiving.py | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diffs (49 lines):
diff -r 3727538c28b3 -r 87644975736c src/common/message_archiving.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/common/message_archiving.py Sun Jul 12 16:32:01 2009 +0200
@@ -0,0 +1,45 @@
+# -*- coding:utf-8 -*-
+## src/common/message_archiving.py
+##
+## Copyright (C) 2009 Anaël Verrier <elghinn AT free.fr>
+##
+## This file is part of Gajim.
+##
+## Gajim is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published
+## by the Free Software Foundation; version 3 only.
+##
+## Gajim is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
+##
+
+
+class ArchivingPreferences:
+ def __init__(self):
+ self.auto = None
+ self.method_auto = None
+ self.method_local = None
+ self.method_manual = None
+ self.default = None
+ self.items = {}
+
+ def set(self, auto, method_auto, method_local, method_manual, default):
+ self.auto = auto
+ self.method_auto = method_auto
+ self.method_local = method_local
+ self.method_manual = method_manual
+ self.default = default
+
+ def set_default(self, expire, otr, save):
+ self.default = {'expire': expire, 'otr': otr, 'save': save}
+
+ def append_or_update_item(self, jid, expire, otr, save):
+ self.items[jid] = {'expire': expire, 'otr': otr, 'save': save}
+
+ def remove_item(self, jid):
+ del self.items[jid]