fix registering an account
This commit is contained in:
parent
b4e06e4efe
commit
89540b0c2e
4 changed files with 23 additions and 20 deletions
|
@ -12,6 +12,12 @@
|
||||||
</row>
|
</row>
|
||||||
</data>
|
</data>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkListStore" id="server_liststore">
|
||||||
|
<columns>
|
||||||
|
<!-- column-name gchararray1 -->
|
||||||
|
<column type="gchararray"/>
|
||||||
|
</columns>
|
||||||
|
</object>
|
||||||
<object class="GtkEntryCompletion" id="server_entrycompletion">
|
<object class="GtkEntryCompletion" id="server_entrycompletion">
|
||||||
<property name="model">server_liststore</property>
|
<property name="model">server_liststore</property>
|
||||||
<property name="text_column">0</property>
|
<property name="text_column">0</property>
|
||||||
|
@ -36,6 +42,7 @@
|
||||||
<object class="GtkNotebook" id="notebook">
|
<object class="GtkNotebook" id="notebook">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="show_tabs">False</property>
|
||||||
<property name="show_border">False</property>
|
<property name="show_border">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkVBox" id="vbox78">
|
<object class="GtkVBox" id="vbox78">
|
||||||
|
@ -276,7 +283,7 @@ to the Jabber network.</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="use_action_appearance">False</property>
|
<property name="use_action_appearance">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="xalign">0.5</property>
|
<property name="xalign">0</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
<signal name="toggled" handler="on_anonymous_checkbutton1_toggled" swapped="no"/>
|
<signal name="toggled" handler="on_anonymous_checkbutton1_toggled" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
|
@ -404,7 +411,7 @@ to the Jabber network.</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="use_action_appearance">False</property>
|
<property name="use_action_appearance">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="xalign">0.5</property>
|
<property name="xalign">0</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -484,7 +491,7 @@ to the Jabber network.</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="use_action_appearance">False</property>
|
<property name="use_action_appearance">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="xalign">0.5</property>
|
<property name="xalign">0</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
<signal name="toggled" handler="on_custom_host_port_checkbutton_toggled" swapped="no"/>
|
<signal name="toggled" handler="on_custom_host_port_checkbutton_toggled" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
|
@ -649,7 +656,7 @@ SHA1 fingerprint of the certificate:
|
||||||
<property name="receives_default">False</property>
|
<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="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="use_action_appearance">False</property>
|
||||||
<property name="xalign">0.5</property>
|
<property name="xalign">0</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -793,7 +800,7 @@ Please wait...</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="use_action_appearance">False</property>
|
<property name="use_action_appearance">False</property>
|
||||||
<property name="use_underline">True</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="active">True</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
</object>
|
</object>
|
||||||
|
@ -812,7 +819,7 @@ Please wait...</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="use_action_appearance">False</property>
|
<property name="use_action_appearance">False</property>
|
||||||
<property name="use_underline">True</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="active">True</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
</object>
|
</object>
|
||||||
|
@ -1028,10 +1035,4 @@ Please wait...</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkListStore" id="server_liststore">
|
|
||||||
<columns>
|
|
||||||
<!-- column-name gchararray1 -->
|
|
||||||
<column type="gchararray"/>
|
|
||||||
</columns>
|
|
||||||
</object>
|
|
||||||
</interface>
|
</interface>
|
||||||
|
|
|
@ -913,8 +913,8 @@ class Connection(CommonConnection, ConnectionHandlers):
|
||||||
self.connection.SendAndCallForResponse(iq,
|
self.connection.SendAndCallForResponse(iq,
|
||||||
_on_register_result)
|
_on_register_result)
|
||||||
else:
|
else:
|
||||||
if self.new_account_form.keys().sort() != \
|
if list(self.new_account_form.keys()).sort() != \
|
||||||
conf.keys().sort():
|
list(conf.keys()).sort():
|
||||||
# requested config has changed since first connection
|
# requested config has changed since first connection
|
||||||
reason = _('Server %s provided a different '
|
reason = _('Server %s provided a different '
|
||||||
'registration form') % data[0]
|
'registration form') % data[0]
|
||||||
|
|
|
@ -1560,12 +1560,13 @@ class NewAccountConnectedEvent(nec.NetworkIncomingEvent):
|
||||||
try:
|
try:
|
||||||
self.errnum = self.conn.connection.Connection.ssl_errnum
|
self.errnum = self.conn.connection.Connection.ssl_errnum
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.errnum = -1 # we don't have an errnum
|
self.errnum = [] # we don't have an errnum
|
||||||
self.ssl_msg = ''
|
self.ssl_msg = ''
|
||||||
if self.errnum > 0:
|
for er in self.errnum:
|
||||||
from common.connection import ssl_error
|
if er > 0:
|
||||||
self.ssl_msg = ssl_error.get(self.errnum, _(
|
from common.connection import ssl_error
|
||||||
'Unknown SSL error: %d') % self.errnum)
|
self.ssl_msg = ssl_error.get(er, _('Unknown SSL error: %d') % \
|
||||||
|
er)
|
||||||
self.ssl_cert = ''
|
self.ssl_cert = ''
|
||||||
if hasattr(self.conn.connection.Connection, 'ssl_cert_pem'):
|
if hasattr(self.conn.connection.Connection, 'ssl_cert_pem'):
|
||||||
self.ssl_cert = self.conn.connection.Connection.ssl_cert_pem
|
self.ssl_cert = self.conn.connection.Connection.ssl_cert_pem
|
||||||
|
|
|
@ -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).'''
|
multiple - these which may contain more data (with <reported/> element).'''
|
||||||
|
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Gdk
|
||||||
from gi.repository import GdkPixbuf
|
from gi.repository import GdkPixbuf
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
import base64
|
import base64
|
||||||
|
@ -566,7 +567,7 @@ class SingleForm(Gtk.Table, object):
|
||||||
for uri in field.media.uris:
|
for uri in field.media.uris:
|
||||||
if uri.type_.startswith('image/'):
|
if uri.type_.startswith('image/'):
|
||||||
try:
|
try:
|
||||||
img_data = base64.decodestring(uri.uri_data)
|
img_data = base64.b64decode(uri.uri_data)
|
||||||
pixbuf_l = GdkPixbuf.PixbufLoader()
|
pixbuf_l = GdkPixbuf.PixbufLoader()
|
||||||
pixbuf_l.write(img_data)
|
pixbuf_l.write(img_data)
|
||||||
pixbuf_l.close()
|
pixbuf_l.close()
|
||||||
|
|
Loading…
Add table
Reference in a new issue