fix registering an account

This commit is contained in:
Yann Leboulanger 2013-01-04 23:11:07 +01:00
parent b4e06e4efe
commit 89540b0c2e
4 changed files with 23 additions and 20 deletions

View File

@ -12,6 +12,12 @@
</row>
</data>
</object>
<object class="GtkListStore" id="server_liststore">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkEntryCompletion" id="server_entrycompletion">
<property name="model">server_liststore</property>
<property name="text_column">0</property>
@ -36,6 +42,7 @@
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_tabs">False</property>
<property name="show_border">False</property>
<child>
<object class="GtkVBox" id="vbox78">
@ -276,7 +283,7 @@ to the Jabber network.</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0.5</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_anonymous_checkbutton1_toggled" swapped="no"/>
</object>
@ -404,7 +411,7 @@ to the Jabber network.</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0.5</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@ -484,7 +491,7 @@ to the Jabber network.</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0.5</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_custom_host_port_checkbutton_toggled" swapped="no"/>
</object>
@ -649,7 +656,7 @@ SHA1 fingerprint of the certificate:
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="use_action_appearance">False</property>
<property name="xalign">0.5</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@ -793,7 +800,7 @@ Please wait...</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0.5</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@ -812,7 +819,7 @@ Please wait...</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0.5</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@ -1028,10 +1035,4 @@ Please wait...</property>
</object>
</child>
</object>
<object class="GtkListStore" id="server_liststore">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
</object>
</interface>

View File

@ -913,8 +913,8 @@ class Connection(CommonConnection, ConnectionHandlers):
self.connection.SendAndCallForResponse(iq,
_on_register_result)
else:
if self.new_account_form.keys().sort() != \
conf.keys().sort():
if list(self.new_account_form.keys()).sort() != \
list(conf.keys()).sort():
# requested config has changed since first connection
reason = _('Server %s provided a different '
'registration form') % data[0]

View File

@ -1560,12 +1560,13 @@ class NewAccountConnectedEvent(nec.NetworkIncomingEvent):
try:
self.errnum = self.conn.connection.Connection.ssl_errnum
except AttributeError:
self.errnum = -1 # we don't have an errnum
self.errnum = [] # we don't have an errnum
self.ssl_msg = ''
if self.errnum > 0:
from common.connection import ssl_error
self.ssl_msg = ssl_error.get(self.errnum, _(
'Unknown SSL error: %d') % self.errnum)
for er in self.errnum:
if er > 0:
from common.connection import ssl_error
self.ssl_msg = ssl_error.get(er, _('Unknown SSL error: %d') % \
er)
self.ssl_cert = ''
if hasattr(self.conn.connection.Connection, 'ssl_cert_pem'):
self.ssl_cert = self.conn.connection.Connection.ssl_cert_pem

View File

@ -26,6 +26,7 @@ single means these with one record of data (without <reported/> element),
multiple - these which may contain more data (with <reported/> element).'''
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GObject
import base64
@ -566,7 +567,7 @@ class SingleForm(Gtk.Table, object):
for uri in field.media.uris:
if uri.type_.startswith('image/'):
try:
img_data = base64.decodestring(uri.uri_data)
img_data = base64.b64decode(uri.uri_data)
pixbuf_l = GdkPixbuf.PixbufLoader()
pixbuf_l.write(img_data)
pixbuf_l.close()