| 1139 |
1139 |
| 1140 static void jabber_unregister_account_iq_cb(JabberStream *js, xmlnode *packet, gpointer data) { |
1140 static void jabber_unregister_account_iq_cb(JabberStream *js, xmlnode *packet, gpointer data) { |
| 1141 PurpleAccount *account = purple_connection_get_account(js->gc); |
1141 PurpleAccount *account = purple_connection_get_account(js->gc); |
| 1142 const char *type = xmlnode_get_attrib(packet,"type"); |
1142 const char *type = xmlnode_get_attrib(packet,"type"); |
| 1143 if(!strcmp(type,"error")) { |
1143 if(!strcmp(type,"error")) { |
| 1144 char *msg = jabber_parse_error(js, packet); |
1144 char *msg = jabber_parse_error(js, packet, NULL); |
| 1145 |
1145 |
| 1146 purple_notify_error(js->gc, _("Error unregistering account"), |
1146 purple_notify_error(js->gc, _("Error unregistering account"), |
| 1147 _("Error unregistering account"), msg); |
1147 _("Error unregistering account"), msg); |
| 1148 g_free(msg); |
1148 g_free(msg); |
| 1149 if(js->unregistration_cb) |
1149 if(js->unregistration_cb) |
| 1911 text = _("Unexpected Request"); |
1916 text = _("Unexpected Request"); |
| 1912 } else if(xmlnode_get_child(error, "undefined-condition")) { |
1917 } else if(xmlnode_get_child(error, "undefined-condition")) { |
| 1913 text = _("Unknown Error"); |
1918 text = _("Unknown Error"); |
| 1914 } |
1919 } |
| 1915 } else if(xmlns && !strcmp(xmlns, "urn:ietf:params:xml:ns:xmpp-sasl")) { |
1920 } else if(xmlns && !strcmp(xmlns, "urn:ietf:params:xml:ns:xmpp-sasl")) { |
| |
1921 /* Most common reason can be the default */ |
| |
1922 SET_REASON(PURPLE_REASON_AUTHENTICATION_FAILED); |
| 1916 if(xmlnode_get_child(packet, "aborted")) { |
1923 if(xmlnode_get_child(packet, "aborted")) { |
| 1917 js->gc->wants_to_die = TRUE; |
|
| 1918 text = _("Authorization Aborted"); |
1924 text = _("Authorization Aborted"); |
| 1919 } else if(xmlnode_get_child(packet, "incorrect-encoding")) { |
1925 } else if(xmlnode_get_child(packet, "incorrect-encoding")) { |
| |
1926 SET_REASON(PURPLE_REASON_NETWORK_ERROR); |
| 1920 text = _("Incorrect encoding in authorization"); |
1927 text = _("Incorrect encoding in authorization"); |
| 1921 } else if(xmlnode_get_child(packet, "invalid-authzid")) { |
1928 } else if(xmlnode_get_child(packet, "invalid-authzid")) { |
| 1922 js->gc->wants_to_die = TRUE; |
|
| 1923 text = _("Invalid authzid"); |
1929 text = _("Invalid authzid"); |
| 1924 } else if(xmlnode_get_child(packet, "invalid-mechanism")) { |
1930 } else if(xmlnode_get_child(packet, "invalid-mechanism")) { |
| 1925 js->gc->wants_to_die = TRUE; |
|
| 1926 text = _("Invalid Authorization Mechanism"); |
1931 text = _("Invalid Authorization Mechanism"); |
| 1927 } else if(xmlnode_get_child(packet, "mechanism-too-weak")) { |
1932 } else if(xmlnode_get_child(packet, "mechanism-too-weak")) { |
| 1928 js->gc->wants_to_die = TRUE; |
|
| 1929 text = _("Authorization mechanism too weak"); |
1933 text = _("Authorization mechanism too weak"); |
| 1930 } else if(xmlnode_get_child(packet, "not-authorized")) { |
1934 } else if(xmlnode_get_child(packet, "not-authorized")) { |
| 1931 js->gc->wants_to_die = TRUE; |
|
| 1932 /* Clear the pasword if it isn't being saved */ |
1935 /* Clear the pasword if it isn't being saved */ |
| 1933 if (!purple_account_get_remember_password(js->gc->account)) |
1936 if (!purple_account_get_remember_password(js->gc->account)) |
| 1934 purple_account_set_password(js->gc->account, NULL); |
1937 purple_account_set_password(js->gc->account, NULL); |
| 1935 text = _("Not Authorized"); |
1938 text = _("Not Authorized"); |
| 1936 } else if(xmlnode_get_child(packet, "temporary-auth-failure")) { |
1939 } else if(xmlnode_get_child(packet, "temporary-auth-failure")) { |
| |
1940 SET_REASON(PURPLE_REASON_NETWORK_ERROR); |
| 1937 text = _("Temporary Authentication Failure"); |
1941 text = _("Temporary Authentication Failure"); |
| 1938 } else { |
1942 } else { |
| 1939 js->gc->wants_to_die = TRUE; |
|
| 1940 text = _("Authentication Failure"); |
1943 text = _("Authentication Failure"); |
| 1941 } |
1944 } |
| 1942 } else if(!strcmp(packet->name, "stream:error") || |
1945 } else if(!strcmp(packet->name, "stream:error") || |
| 1943 (!strcmp(packet->name, "error") && |
1946 (!strcmp(packet->name, "error") && |
| 1944 !strcmp(xmlns, "http://etherx.jabber.org/streams"))) { |
1947 !strcmp(xmlns, "http://etherx.jabber.org/streams"))) { |
| |
1948 /* Most common reason as default: */ |
| |
1949 SET_REASON(PURPLE_REASON_NETWORK_ERROR); |
| 1945 if(xmlnode_get_child(packet, "bad-format")) { |
1950 if(xmlnode_get_child(packet, "bad-format")) { |
| 1946 text = _("Bad Format"); |
1951 text = _("Bad Format"); |
| 1947 } else if(xmlnode_get_child(packet, "bad-namespace-prefix")) { |
1952 } else if(xmlnode_get_child(packet, "bad-namespace-prefix")) { |
| 1948 text = _("Bad Namespace Prefix"); |
1953 text = _("Bad Namespace Prefix"); |
| 1949 } else if(xmlnode_get_child(packet, "conflict")) { |
1954 } else if(xmlnode_get_child(packet, "conflict")) { |
| 1950 js->gc->wants_to_die = TRUE; |
1955 SET_REASON(PURPLE_REASON_NAME_IN_USE); |
| 1951 text = _("Resource Conflict"); |
1956 text = _("Resource Conflict"); |
| 1952 } else if(xmlnode_get_child(packet, "connection-timeout")) { |
1957 } else if(xmlnode_get_child(packet, "connection-timeout")) { |
| 1953 text = _("Connection Timeout"); |
1958 text = _("Connection Timeout"); |
| 1954 } else if(xmlnode_get_child(packet, "host-gone")) { |
1959 } else if(xmlnode_get_child(packet, "host-gone")) { |
| 1955 text = _("Host Gone"); |
1960 text = _("Host Gone"); |