From 4908a8a434d0468f59a1ec3222444fee47675f16 Mon Sep 17 00:00:00 2001 From: Ragner Magalhaes Date: Tue, 2 Dec 2008 21:23:30 +0000 Subject: [PATCH] Remove hardcoded PORT and SERVER values Remove hardcoded PORT and SERVER values. Signed-off-by: Dinorah Monteiro Acked-by: Ragner Magalhaes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1454 596f6dd7-e928-0410-a184-9e12fd12cf7e --- account.pyx | 7 ++++--- plugin.pyx | 5 ----- protocol.pyx | 11 ++++------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/account.pyx b/account.pyx index 7240de2..db56e2c 100644 --- a/account.pyx +++ b/account.pyx @@ -133,9 +133,10 @@ cdef class Account: str_value = accountopt.purple_account_option_get_default_string(option) - # Google Talk default domain hackery! - if str_value == NULL and str( label_name) == "Connect server": - str_value = "talk.google.com" + # Hack to set string "" as default value to Account options when + # the default value of the protocol is NULL + if str_value == NULL: + str_value = "" str_value = account.purple_account_get_string(c_account, setting, str_value) val = str( str_value) diff --git a/plugin.pyx b/plugin.pyx index ac6f704..c5b5f93 100644 --- a/plugin.pyx +++ b/plugin.pyx @@ -97,9 +97,6 @@ cdef class Plugin: if type == prefs.PURPLE_PREF_STRING: str_value = accountopt.purple_account_option_get_default_string(option) - # Google Talk default domain hackery! - if str_value == NULL and label == "Connect server": - str_value = "talk.google.com" if c_account != NULL: str_value = account.purple_account_get_string(c_account, setting, str_value) @@ -107,8 +104,6 @@ cdef class Plugin: elif type == prefs.PURPLE_PREF_INT: int_value = accountopt.purple_account_option_get_default_int(option) - if sett == "port": - int_value = int(443) if c_account != NULL: int_value = account.purple_account_get_int(c_account, setting, int_value) diff --git a/protocol.pyx b/protocol.pyx index c348d7f..08c1e36 100644 --- a/protocol.pyx +++ b/protocol.pyx @@ -120,17 +120,14 @@ cdef class Protocol: if type == prefs.PURPLE_PREF_STRING: str_value = accountopt.purple_account_option_get_default_string(option) - # Google Talk default domain hackery! - if str_value == NULL and sett == "connect_server": - str_value = "talk.google.com" - + # Hack to set string "" as default value when the + # protocol's option is NULL + if str_value == NULL: + str_value = "" val = str( str_value) elif type == prefs.PURPLE_PREF_INT: int_value = accountopt.purple_account_option_get_default_int(option) - if sett == "port": - int_value = int(443) - val = int(int_value) elif type == prefs.PURPLE_PREF_BOOLEAN: -- 1.7.9.5