gajim: * added some methods to request a page of collections lis...

2009-08-05 Thread Anaƫl Verrier
changeset e042801acd92 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=e042801acd92
description: * added some methods to request a page of collections list, 
request a page of a collection, remove a collection and request a page of 
modifications (XEP-0136)

diffstat:

 src/common/message_archiving.py |  57 
 1 files changed, 57 insertions(+), 0 deletions(-)

diffs (64 lines):

diff -r 2a4eba9db8c6 -r e042801acd92 src/common/message_archiving.py
--- a/src/common/message_archiving.py   Wed Aug 05 18:05:23 2009 +0200
+++ b/src/common/message_archiving.py   Wed Aug 05 19:05:12 2009 +0200
@@ -134,3 +134,60 @@
del self.items[item.getAttr('jid')]
self.dispatch('ARCHIVING_CHANGED', 
('itemremove',
item.getAttr('jid')))
+
+   def request_collections_list_page(self, with='', start=None, end=None,
+   after=None, max=30, exact_match=False):
+   iq_ = common.xmpp.Iq('get')
+   list_ = iq_.setTag('list', namespace=common.xmpp.NS_ARCHIVE)
+   if with:
+   list_.setAttr('with', with)
+   if exact_match:
+   list_.setAttr('exactmatch', 'true')
+   if start:
+   list_.setAttr('start', start)
+   if end:
+   list_.setAttr('end', end)
+   set_ = list_.setTag('set', namespace=common.xmpp.NS_RSM)
+   set_.setTagData('max', max)
+   if after:
+   set_.setTagData('after', after)
+   self.connection.send(iq_)
+
+   def request_collection_page(self, with, start, end=None, after=None,
+   max=30, exact_match=False):
+   iq_ = common.xmpp.Iq('get')
+   retrieve = iq_.setTag('retrieve', 
namespace=common.xmpp.NS_ARCHIVE,
+   attrs={'with': with, 'start': start})
+   if exact_match:
+   retrieve.setAttr('exactmatch', 'true')
+   set_ = retrieve.setTag('set', namespace=common.xmpp.NS_RSM)
+   set_.setTagData('max', max)
+   if after:
+   set_.setTagData('after', after)
+   self.connection.send(iq_)
+   
+   def remove_collection(self, with='', start=None, end=None,
+   exact_match=False, open=False):
+   iq_ = common.xmpp.Iq('set')
+   remove = iq_.setTag('remove', namespace=common.xmpp.NS_ARCHIVE)
+   if with:
+   remove.setAttr('with', with)
+   if exact_match:
+   remove.setAttr('exactmatch', 'true')
+   if start:
+   remove.setAttr('start', start)
+   if end:
+   remove.setAttr('end', end)
+   if open:
+   remove.setAttr('open', 'true')
+   self.connection.send(iq_)
+   
+   def request_modifications_page(self, start, version, after=None, 
max=30):
+   iq_ = common.xmpp.Iq('get')
+   moified = iq_.setTag('modified', 
namespace=common.xmpp.NS_ARCHIVE,
+   attrs={'start': start, 'version': version})
+   set_ = retrieve.setTag('set', namespace=common.xmpp.NS_RSM)
+   set_.setTagData('max', max)
+   if after:
+   set_.setTagData('after', after)
+   self.connection.send(iq_)
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: select chat window once we open a new one

2009-08-05 Thread Yann Leboulanger
changeset 54ca23b71bf8 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=54ca23b71bf8
description: select chat window once we open a new one

diffstat:

 src/gajim.py |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r d93fc2eebd71 -r 54ca23b71bf8 src/gajim.py
--- a/src/gajim.py  Wed Aug 05 20:53:58 2009 +0200
+++ b/src/gajim.py  Wed Aug 05 21:03:50 2009 +0200
@@ -2909,6 +2909,7 @@
# For JEP-0172
if added_to_roster:
ctrl.user_nick = gajim.nicks[account]
+   gobject.idle_add(lambda: mw.window.grab_focus())
 
def on_open_chat_window(self, widget, contact, account, resource=None,
session=None):
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: handle strange notification daemon version values. Fixes ...

2009-08-05 Thread Yann Leboulanger
changeset 437f65eb635c in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=437f65eb635c
description: handle strange notification daemon version values. Fixes #5209

diffstat:

 src/notify.py |  7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r 54ca23b71bf8 -r 437f65eb635c src/notify.py
--- a/src/notify.py Wed Aug 05 21:03:50 2009 +0200
+++ b/src/notify.py Wed Aug 05 23:13:47 2009 +0200
@@ -654,8 +654,11 @@
version = '0.9'
version_list = version.split('.')
self.version = []
-   while len(version_list):
-   self.version.append(int(version_list.pop(0)))
+   try:
+   while len(version_list):
+   self.version.append(int(version_list.pop(0)))
+   except ValueError:
+   self.version_error_handler_3_x_try(None)
self.attempt_notify()
 
def get_version(self):
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: strip JID in add contact dialog. Fixes #5200

2009-08-05 Thread Yann Leboulanger
changeset ae0fc79f426d in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=ae0fc79f426d
description: strip JID in add contact dialog. Fixes #5200

diffstat:

 src/dialogs.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 190d49eb3283 -r ae0fc79f426d src/dialogs.py
--- a/src/dialogs.pyWed Aug 05 23:58:25 2009 +0200
+++ b/src/dialogs.pyThu Aug 06 00:01:07 2009 +0200
@@ -965,7 +965,7 @@
 
def on_add_button_clicked(self, widget):
'''When Subscribe button is clicked'''
-   jid = self.uid_entry.get_text().decode('utf-8')
+   jid = self.uid_entry.get_text().decode('utf-8').strip()
if not jid:
return
 
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: prevent traceback. Fixes #5202

2009-08-05 Thread Yann Leboulanger
changeset 933547e776e2 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=933547e776e2
description: prevent traceback. Fixes #5202

diffstat:

 src/common/connection.py |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r ae0fc79f426d -r 933547e776e2 src/common/connection.py
--- a/src/common/connection.py  Thu Aug 06 00:01:07 2009 +0200
+++ b/src/common/connection.py  Thu Aug 06 00:07:23 2009 +0200
@@ -1880,6 +1880,8 @@
self.connection.send(iq)
 
def send_gc_config(self, room_jid, form):
+   if not self.connection:
+   return
iq = common.xmpp.Iq(typ = 'set', to = room_jid, queryNS =\
common.xmpp.NS_MUC_OWNER)
query = iq.getTag('query')
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: print error message when PyGTK fails to be imported

2009-08-05 Thread Yann Leboulanger
changeset 63aba313b3af in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=63aba313b3af
description: print error message when PyGTK fails to be imported

diffstat:

 src/gajim.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r 58d2813366a6 -r 63aba313b3af src/gajim.py
--- a/src/gajim.py  Thu Jul 30 18:06:52 2009 +0200
+++ b/src/gajim.py  Fri Jul 31 10:54:35 2009 +0200
@@ -178,7 +178,9 @@
 except Warning, msg:
if str(msg) == 'could not open display':
print  sys.stderr, _('Gajim needs X server to run. 
Quiting...')
-   sys.exit()
+   else:
+   print  sys.stderr, 'importing PyGTK failed: %s' % msg
+   sys.exit()
 warnings.resetwarnings()
 
 if os.name == 'nt':
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: backport a fix from default branch. Fixes #5203

2009-08-05 Thread Yann Leboulanger
changeset cc66a24336c3 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=cc66a24336c3
description: backport a fix from default branch. Fixes #5203

diffstat:

 src/gajim.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 63aba313b3af -r cc66a24336c3 src/gajim.py
--- a/src/gajim.py  Fri Jul 31 10:54:35 2009 +0200
+++ b/src/gajim.py  Thu Aug 06 00:14:00 2009 +0200
@@ -1001,7 +1001,8 @@
if array[3]:
msg = _('error while sending %(message)s ( %(error)s 
)') % {
'message': array[3], 'error': msg}
-   array[5].roster_message(jid, msg, array[4], msg_type='error')
+   if session:
+   session.roster_message(jid, msg, array[4], 
msg_type='error')
 
def handle_event_msgsent(self, account, array):
#('MSGSENT', account, (jid, msg, keyID))
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits