gajim: show incoming and outgoing style in history window too. F...

2009-10-13 Thread Yann Leboulanger
changeset beaa08c86859 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=beaa08c86859
description: show incoming and outgoing style in history window too. Fixes #5321

diffstat:

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

diffs (19 lines):

diff -r 4ef4f9964cab -r beaa08c86859 src/history_window.py
--- a/src/history_window.py Tue Oct 13 21:44:14 2009 +0200
+++ b/src/history_window.py Wed Oct 14 08:40:28 2009 +0200
@@ -409,6 +409,7 @@
constants.KIND_CHAT_MSG_RECV):
contact_name = 
self.completion_dict[self.jid][C_INFO_NAME]
tag_name = 'incoming'
+   tag_msg = 'incomingtxt'
elif kind in (constants.KIND_SINGLE_MSG_SENT,
constants.KIND_CHAT_MSG_SENT):
if self.account:
@@ -419,6 +420,7 @@
account = gajim.contacts.get_accounts()[0]
contact_name = gajim.nicks[account]
tag_name = 'outgoing'
+   tag_msg = 'outgoingtxt'
elif kind == constants.KIND_GCSTATUS:
# message here (if not None) is status message
if message:
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: prevent traceback in upgrade function

2009-10-13 Thread Yann Leboulanger
changeset 4ef4f9964cab in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=4ef4f9964cab
description: prevent traceback in upgrade function

diffstat:

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

diffs (21 lines):

diff -r c02ab1f90645 -r 4ef4f9964cab src/common/optparser.py
--- a/src/common/optparser.py   Tue Oct 13 20:27:12 2009 +0200
+++ b/src/common/optparser.py   Tue Oct 13 21:44:14 2009 +0200
@@ -760,6 +760,8 @@
'urlmsgcolor': ['#ff', '#204a87'],
'gc_nicknames_colors': 
['#a34526:#c000ff:#0012ff:#388a99:#045723:#7c7c7c:#ff8a00:#94452d:#244b5a:#32645a',
 
'#4e9a06:#f57900:#ce5c00:#3465a4:#204a87:#75507b:#5c3566:#c17d11:#8f5902:#ef2929:#cc:#a4']}
for c in vals:
+   if c not in self.old_values:
+   continue
val = self.old_values[c]
if val == vals[c][0]:
# We didn't change default value, so update it 
with new default
@@ -770,6 +772,8 @@
vals = {'statusmsgcolor': ['#73d216', '#4e9a06'],
'outmsgtxtcolor': ['#a2a2a2', '#555753']}
for c in vals:
+   if c not in self.old_values:
+   continue
val = self.old_values[c]
if val == vals[c][0]:
# We didn't change default value, so update it 
with new default
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: typo

2009-10-13 Thread Yann Leboulanger
changeset c02ab1f90645 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=c02ab1f90645
description: typo

diffstat:

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

diffs (12 lines):

diff -r 071314b0a82f -r c02ab1f90645 src/common/optparser.py
--- a/src/common/optparser.py   Tue Oct 13 20:05:45 2009 +0200
+++ b/src/common/optparser.py   Tue Oct 13 20:27:12 2009 +0200
@@ -766,7 +766,7 @@
gajim.config.set(c, vals[c][1])
gajim.config.set('version', '0.12.5.4')
 
-   def update_config_to_01254(self):
+   def update_config_to_01255(self):
vals = {'statusmsgcolor': ['#73d216', '#4e9a06'],
'outmsgtxtcolor': ['#a2a2a2', '#555753']}
for c in vals:
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: update some colors. Fixes #5321

2009-10-13 Thread Yann Leboulanger
changeset 071314b0a82f in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=071314b0a82f
description: update some colors. Fixes #5321

diffstat:

 configure.ac|   2 +-
 src/common/config.py|   4 ++--
 src/common/defs.py  |   2 +-
 src/common/optparser.py |  12 
 4 files changed, 16 insertions(+), 4 deletions(-)

diffs (63 lines):

diff -r 6b042017c159 -r 071314b0a82f configure.ac
--- a/configure.ac  Tue Oct 13 19:31:07 2009 +0200
+++ b/configure.ac  Tue Oct 13 20:05:45 2009 +0200
@@ -1,5 +1,5 @@
 AC_INIT([Gajim - A Jabber Instant Messager],
-   [0.12.5.4-dev],[http://trac.gajim.org/],[gajim])
+   [0.12.5.5-dev],[http://trac.gajim.org/],[gajim])
 AC_PREREQ([2.59])
 
 AC_CONFIG_HEADER(config.h)
diff -r 6b042017c159 -r 071314b0a82f src/common/config.py
--- a/src/common/config.py  Tue Oct 13 19:31:07 2009 +0200
+++ b/src/common/config.py  Tue Oct 13 20:05:45 2009 +0200
@@ -93,8 +93,8 @@
'inmsgcolor': [ opt_color, '#a4', _('Incoming nickname 
color.'), True ],
'outmsgcolor': [ opt_color, '#3465a4', _('Outgoing nickname 
color.'), True ],
'inmsgtxtcolor': [ opt_color, '', _('Incoming text color.'), 
True ],
-   'outmsgtxtcolor': [ opt_color, '#a2a2a2', _('Outgoing text 
color.'), True ],
-   'statusmsgcolor': [ opt_color, '#73d216', _('Status message 
text color.'), True ],
+   'outmsgtxtcolor': [ opt_color, '#555753', _('Outgoing text 
color.'), True ],
+   'statusmsgcolor': [ opt_color, '#4e9a06', _('Status message 
text color.'), True ],
'markedmsgcolor': [ opt_color, '#ff8080', '', True ],
'urlmsgcolor': [ opt_color, '#204a87', '', True ],
'inmsgfont': [ opt_str, '', _('Incoming nickname font.'), True 
],
diff -r 6b042017c159 -r 071314b0a82f src/common/defs.py
--- a/src/common/defs.pyTue Oct 13 19:31:07 2009 +0200
+++ b/src/common/defs.pyTue Oct 13 20:05:45 2009 +0200
@@ -27,7 +27,7 @@
 datadir = '../'
 localedir = '../po'
 
-version = '0.12.5.4-dev'
+version = '0.12.5.5-dev'
 
 import sys, os.path
 for base in ('.', 'common'):
diff -r 6b042017c159 -r 071314b0a82f src/common/optparser.py
--- a/src/common/optparser.py   Tue Oct 13 19:31:07 2009 +0200
+++ b/src/common/optparser.py   Tue Oct 13 20:05:45 2009 +0200
@@ -208,6 +208,8 @@
self.update_config_to_01253()
if old < [0, 12, 5, 4] and new >= [0, 12, 5, 4]:
self.update_config_to_01254()
+   if old < [0, 12, 5, 5] and new >= [0, 12, 5, 5]:
+   self.update_config_to_01255()
 
gajim.logger.init_vars()
gajim.config.set('version', new_version)
@@ -764,4 +766,14 @@
gajim.config.set(c, vals[c][1])
gajim.config.set('version', '0.12.5.4')
 
+   def update_config_to_01254(self):
+   vals = {'statusmsgcolor': ['#73d216', '#4e9a06'],
+   'outmsgtxtcolor': ['#a2a2a2', '#555753']}
+   for c in vals:
+   val = self.old_values[c]
+   if val == vals[c][0]:
+   # We didn't change default value, so update it 
with new default
+   gajim.config.set(c, vals[c][1])
+   gajim.config.set('version', '0.12.5.5')
+
 # vim: se ts=3:
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: fix typo

2009-10-13 Thread Yann Leboulanger
changeset 6b042017c159 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=6b042017c159
description: fix typo

diffstat:

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

diffs (12 lines):

diff -r 4d5a335069ef -r 6b042017c159 src/common/connection_handlers.py
--- a/src/common/connection_handlers.py Tue Oct 13 19:26:56 2009 +0200
+++ b/src/common/connection_handlers.py Tue Oct 13 19:31:07 2009 +0200
@@ -2253,7 +2253,7 @@
# Error presences may not include sent stanza, so we 
don't detect it's
# a muc preence. So detect it by ID
h = hmac.new(self.secret_hmac, 
jid_stripped).hexdigest()[:6]
-   if id_.split('_')[-1] = h:
+   if id_.split('_')[-1] == h:
is_gc = True
status = prs.getStatus() or ''
show = prs.getShow()
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: detect incoming MUC error presences from the ID. Fixes #5309

2009-10-13 Thread Yann Leboulanger
changeset 4d5a335069ef in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=4d5a335069ef
description: detect incoming MUC error presences from the ID. Fixes #5309

diffstat:

 src/common/connection.py  |  14 --
 src/common/connection_handlers.py |   9 +
 2 files changed, 21 insertions(+), 2 deletions(-)

diffs (78 lines):

diff -r 6ba8d19efca7 -r 4d5a335069ef src/common/connection.py
--- a/src/common/connection.py  Tue Oct 13 17:38:42 2009 +0300
+++ b/src/common/connection.py  Tue Oct 13 19:26:56 2009 +0200
@@ -39,6 +39,7 @@
 
 import time
 import locale
+import hmac
 
 try:
randomsource = random.SystemRandom()
@@ -190,6 +191,7 @@
self.vcard_supported = False
self.private_storage_supported = True
self.streamError = ''
+   self.secret_hmac = str(random.random())[2:]
# END __init__
 
def put_event(self, ev):
@@ -1775,8 +1777,12 @@
last_log = 0
self.last_history_time[room_jid] = last_log
 
-   p = common.xmpp.Presence(to = '%s/%s' % (room_jid, nick),
-   show = show, status = self.status)
+   p = common.xmpp.Presence(to='%s/%s' % (room_jid, nick),
+   show=show, status=self.status)
+   h = hmac.new(self.secret_hmac, room_jid).hexdigest()[:6]
+   id_ = self.connection.getAnID()
+   id_ = 'gajim_muc_' + id_ + '_' + h
+   p.setID(id_)
if gajim.config.get('send_sha_in_gc_presence'):
p = self.add_sha(p)
self.add_lang(p)
@@ -1843,6 +1849,10 @@
xmpp_show = helpers.get_xmpp_show(show)
p = common.xmpp.Presence(to = '%s/%s' % (jid, nick), typ = 
ptype,
show = xmpp_show, status = status)
+   h = hmac.new(self.secret_hmac, jid).hexdigest()[:6]
+   id_ = self.connection.getAnID()
+   id_ = 'gajim_muc_' + id_ + '_' + h
+   p.setID(id_)
if gajim.config.get('send_sha_in_gc_presence') and show != 
'offline':
p = self.add_sha(p, ptype != 'unavailable')
self.add_lang(p)
diff -r 6ba8d19efca7 -r 4d5a335069ef src/common/connection_handlers.py
--- a/src/common/connection_handlers.py Tue Oct 13 17:38:42 2009 +0300
+++ b/src/common/connection_handlers.py Tue Oct 13 19:26:56 2009 +0200
@@ -34,6 +34,7 @@
 import sys
 import operator
 import hashlib
+import hmac
 
 from time import (altzone, daylight, gmtime, localtime, mktime, strftime,
time as time_time, timezone, tzname)
@@ -2207,6 +2208,7 @@
return
jid_stripped, resource = gajim.get_room_and_nick_from_fjid(who)
timestamp = None
+   id_ = prs.getID()
is_gc = False # is it a GC presence ?
sigTag = None
ns_muc_user_x = None
@@ -2246,6 +2248,13 @@
if self.connection.getRoster().getItem(agent): 
# to be sure it's a transport contact
transport_auto_auth = True
 
+   if not is_gc and id_ and id_.startswith('gajim_muc_') and \
+   ptype == 'error':
+   # Error presences may not include sent stanza, so we 
don't detect it's
+   # a muc preence. So detect it by ID
+   h = hmac.new(self.secret_hmac, 
jid_stripped).hexdigest()[:6]
+   if id_.split('_')[-1] = h:
+   is_gc = True
status = prs.getStatus() or ''
show = prs.getShow()
if not show in gajim.SHOW_LIST:
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: Improved the lookup of the minimized control

2009-10-13 Thread red-agent
changeset 6ba8d19efca7 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=6ba8d19efca7
description: Improved the lookup of the minimized control

diffstat:

 src/common/connection_handlers.py |  12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (22 lines):

diff -r 88c7b85875cc -r 6ba8d19efca7 src/common/connection_handlers.py
--- a/src/common/connection_handlers.py Tue Oct 13 13:42:44 2009 +0200
+++ b/src/common/connection_handlers.py Tue Oct 13 17:38:42 2009 +0300
@@ -2277,12 +2277,12 @@
gc_control = 
gajim.interface.msg_win_mgr.get_gc_control(room_jid,
self.name)

-   # gc_control might be in the other place if 
it's minimized. Note:
-   # this solution might have an impact on the 
performance.
-   if gc_control is None and \
-   room_jid in 
gajim.interface.minimized_controls[self.name]:
-   gc_control = 
gajim.interface.minimized_controls[self.name][
-   room_jid]
+   # If gc_control is missing - it may be 
minimized. Try to get it from
+   # there. If it's not there - then it's missing 
anyway and will
+   # remain set to None.
+   if gc_control is None:
+   minimized = 
gajim.interface.minimized_controls[self.name]
+   gc_control = minimized.get(room_jid)
 
if errcode == '502':
# Internal Timeout:
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: [Xytovl] ability to configure font and colors of incoming...

2009-10-13 Thread Yann Leboulanger
changeset 88c7b85875cc in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=88c7b85875cc
description: [Xytovl] ability to configure font and colors of incoming / 
outgoing messages. Fixes #5311

diffstat:

 src/common/config.py |  13 ++---
 src/conversation_textview.py |  26 ++
 2 files changed, 36 insertions(+), 3 deletions(-)

diffs (75 lines):

diff -r fc299c3f9e9c -r 88c7b85875cc src/common/config.py
--- a/src/common/config.py  Tue Oct 13 12:56:14 2009 +0200
+++ b/src/common/config.py  Tue Oct 13 13:42:44 2009 +0200
@@ -90,11 +90,18 @@
'mood_iconset': [ opt_str, DEFAULT_MOOD_ICONSET, '', True ],
'activity_iconset': [ opt_str, DEFAULT_ACTIVITY_ICONSET, '', 
True ],
'use_transports_iconsets': [ opt_bool, True, '', True ],
-   'inmsgcolor': [ opt_color, '#a4', '', True ],
-   'outmsgcolor': [ opt_color, '#3465a4', '', True ],
-   'statusmsgcolor': [ opt_color, '#73d216', '', True ],
+   'inmsgcolor': [ opt_color, '#a4', _('Incoming nickname 
color.'), True ],
+   'outmsgcolor': [ opt_color, '#3465a4', _('Outgoing nickname 
color.'), True ],
+   'inmsgtxtcolor': [ opt_color, '', _('Incoming text color.'), 
True ],
+   'outmsgtxtcolor': [ opt_color, '#a2a2a2', _('Outgoing text 
color.'), True ],
+   'statusmsgcolor': [ opt_color, '#73d216', _('Status message 
text color.'), True ],
'markedmsgcolor': [ opt_color, '#ff8080', '', True ],
'urlmsgcolor': [ opt_color, '#204a87', '', True ],
+   'inmsgfont': [ opt_str, '', _('Incoming nickname font.'), True 
],
+   'outmsgfont': [ opt_str, '', _('Outgoing nickname font.'), True 
],
+   'inmsgtxtfont': [ opt_str, '', _('Incoming text font.'), True ],
+   'outmsgtxtfont': [ opt_str, '', _('Outgoing text font.'), True 
],
+   'statusmsgfont': [ opt_str, '', _('Status message text font.'), 
True ],
'collapsed_rows': [ opt_str, '', _('List (space separated) of 
rows (accounts and groups) that are collapsed.'), True ],
'roster_theme': [ opt_str, _('default'), '', True ],
'mergeaccounts': [ opt_bool, False, '', True ],
diff -r fc299c3f9e9c -r 88c7b85875cc src/conversation_textview.py
--- a/src/conversation_textview.py  Tue Oct 13 12:56:14 2009 +0200
+++ b/src/conversation_textview.py  Tue Oct 13 13:42:44 2009 +0200
@@ -230,13 +230,35 @@
 
self.tagIn = buffer_.create_tag('incoming')
color = gajim.config.get('inmsgcolor')
+   font = pango.FontDescription(gajim.config.get('inmsgfont'))
self.tagIn.set_property('foreground', color)
+   self.tagIn.set_property('font-desc', font)
+
self.tagOut = buffer_.create_tag('outgoing')
color = gajim.config.get('outmsgcolor')
+   font = pango.FontDescription(gajim.config.get('outmsgfont'))
self.tagOut.set_property('foreground', color)
+   self.tagOut.set_property('font-desc', font)
+
self.tagStatus = buffer_.create_tag('status')
color = gajim.config.get('statusmsgcolor')
+   font = pango.FontDescription(gajim.config.get('satusmsgfont'))
self.tagStatus.set_property('foreground', color)
+   self.tagStatus.set_property('font-desc', font)
+
+   self.tagInText = buffer_.create_tag('incomingtxt')
+   color = gajim.config.get('inmsgtxtcolor')
+   font = pango.FontDescription(gajim.config.get('inmsgtxtfont'))
+   if color:
+   self.tagInText.set_property('foreground', color)
+   self.tagInText.set_property('font-desc', font)
+
+   self.tagOutText = buffer_.create_tag('outgoingtxt')
+   color = gajim.config.get('outmsgtxtcolor')
+   if color:
+   font = 
pango.FontDescription(gajim.config.get('outmsgtxtfont'))
+   self.tagOutText.set_property('foreground', color)
+   self.tagOutText.set_property('font-desc', font)
 
colors = gajim.config.get('gc_nicknames_colors')
colors = colors.split(':')
@@ -1219,6 +1241,10 @@

'chat_merge_consecutive_nickname_indent'))
else:
self.print_name(name, kind, other_tags_for_name)
+   if kind == 'incoming':
+   text_tags.append('incomingtxt')
+   elif kind == 'outgoing':
+   text_tags.append('outgoingtxt')
self.print_subject(subject)
self.print_real_text(text, text_tags, name, xhtml, 
graphics=graphics)
 
___

gajim: correctly get minimized room

2009-10-13 Thread Yann Leboulanger
changeset fc299c3f9e9c in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=fc299c3f9e9c
description: correctly get minimized room

diffstat:

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

diffs (13 lines):

diff -r 08245526b03f -r fc299c3f9e9c src/common/connection_handlers.py
--- a/src/common/connection_handlers.py Tue Oct 13 07:53:05 2009 +0200
+++ b/src/common/connection_handlers.py Tue Oct 13 12:56:14 2009 +0200
@@ -2281,7 +2281,8 @@
# this solution might have an impact on the 
performance.
if gc_control is None and \
room_jid in 
gajim.interface.minimized_controls[self.name]:
-   gc_control = control
+   gc_control = 
gajim.interface.minimized_controls[self.name][
+   room_jid]
 
if errcode == '502':
# Internal Timeout:
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits