Multiple fixes

Restores use of rememberPassword field. Refactors
SecurityAccountRegistration. Fixes default properties keys. Updates
libjitsi to version that works on Android.
cusax-fix
paweldomas 13 years ago
parent 5728fa3ce7
commit 55ef6a131f

@ -3,7 +3,7 @@ org.jitsi.test.default=This is a default property!
net.java.sip.communicator.service.protocol.DTMF_METHOD=AUTO_DTMF
net.java.sip.communicator.service.protocol.DTMF_MINIMAL_TONE_DURATION=70
# SIP specific properties
net.java.sip.communicator.service.protocol.sip.PORT=5060
net.java.sip.communicator.service.protocol.sip.SERVER_PORT=5060
net.java.sip.communicator.service.protocol.sip.TLS_PORT=5061
net.java.sip.communicator.service.protocol.sip.POLLING_PERIOD=30
net.java.sip.communicator.service.protocol.sip.SUBSCRIPTION_EXPIRATION=3600
@ -13,7 +13,7 @@ net.java.sip.communicator.service.protocol.sip.KEEP_ALIVE_METHOD=OPTIONS
net.java.sip.communicator.service.protocol.sip.TRANSPORT=UDP
net.java.sip.communicator.service.protocol.sip.VOICEMAIL_ENABLED=true
# Jabber specific properties
net.java.sip.communicator.service.protocol.jabber.PORT=5222
net.java.sip.communicator.service.protocol.jabber.SERVER_PORT=5222
net.java.sip.communicator.service.protocol.jabber.IS_SERVER_OVERRIDDEN=false
net.java.sip.communicator.service.protocol.jabber.AUTO_GENERATE_RESOURCE=true
net.java.sip.communicator.service.protocol.jabber.RESOURCE=jitsi

@ -297,11 +297,8 @@ public boolean commitPage(JabberAccountRegistration registration)
registration.setUserID(userID);
if(accountPanel.isRememberPassword())
registration.setPassword(new String(password));
else
registration.setPassword(null);
registration.setRememberPassword(accountPanel.isRememberPassword());
registration.setPassword(new String(password));
registration.setTlsClientCertificate(
connectionPanel.getClientTlsCertificateId());
registration.setServerAddress(serverAddress);

@ -161,7 +161,7 @@ public Iterator<Map.Entry<String,String>> getSummary()
summaryTable.put(
Resources.getString("service.gui.REMEMBER_PASSWORD"),
Boolean.toString(registration.getPassword() != null));
Boolean.toString(registration.isRememberPassword()));
summaryTable.put(
Resources.getString("plugin.jabberaccregwizz.SERVER"),

@ -262,11 +262,9 @@ public boolean commitPage(SIPAccountRegistration registration)
registration.setUserID(userID);
if(!accountPanel.isRememberPassword())
password = null;
registration.setRememberPassword(accountPanel.isRememberPassword());
registration.setPassword(
password != null ? new String(password) : null );
registration.setPassword(new String(password));
registration.setServerAddress(serverAddress);
@ -407,6 +405,7 @@ public void loadAccount(SIPAccountRegistration sipAccReg)
}
else
{
accountPanel.setPassword("");
accountPanel.setRememberPassword(false);
}

@ -153,7 +153,7 @@ public Iterator<Map.Entry<String, String>> getSummary()
LinkedHashMap<String, String> summaryTable
= new LinkedHashMap<String, String>();
boolean rememberPswd = registration.getPassword() != null;
boolean rememberPswd = registration.isRememberPassword();
String rememberPswdString = Resources.getString(
rememberPswd ? "service.gui.YES" : "service.gui.NO");
String displayName = registration.getAccountDisplayName();

@ -5,6 +5,9 @@
*/
package net.java.sip.communicator.service.protocol;
import net.java.sip.communicator.util.*;
import org.jitsi.service.neomedia.*;
import java.io.*;
import java.util.*;
@ -66,6 +69,9 @@ public SecurityAccountRegistration()
this.encryptionProtocols.put("ZRTP", 0);
this.encryptionProtocolStatus = new HashMap<String, Boolean>(1);
this.encryptionProtocolStatus.put("ZRTP", true);
sdesCipherSuites
= UtilActivator.getResources()
.getSettingsString(SDesControl.SDES_CIPHER_SUITES);
}
/**
@ -297,14 +303,39 @@ public void loadAccount(AccountID accountID)
ProtocolProviderFactory.DEFAULT_ENCRYPTION,
true));
encryptionProtocols
encryptionProtocols = new HashMap<String, Integer>();
encryptionProtocolStatus = new HashMap<String, Boolean>();
Map<String, Integer> srcEncryptionProtocols
= accountID.getIntegerPropertiesByPrefix(
ProtocolProviderFactory.ENCRYPTION_PROTOCOL, true);
encryptionProtocolStatus
Map<String, Boolean> srcEncryptionProtocolStatus
= accountID.getBooleanPropertiesByPrefix(
ProtocolProviderFactory.ENCRYPTION_PROTOCOL_STATUS,
true,
false);
// Load stored values.
int prefixeLength
= ProtocolProviderFactory.ENCRYPTION_PROTOCOL.length() + 1;
String name;
boolean enabled;
for(String protocolPropertyName : srcEncryptionProtocols.keySet())
{
name = protocolPropertyName.substring(prefixeLength);
if (isExistingEncryptionProtocol(name))
{
// Copies the priority
encryptionProtocols.put(
name,
srcEncryptionProtocols.get(protocolPropertyName));
// Extracts the status
enabled = srcEncryptionProtocolStatus.get(
ProtocolProviderFactory.ENCRYPTION_PROTOCOL_STATUS
+ "."
+ name);
encryptionProtocolStatus.put(name, enabled);
}
}
setSipZrtpAttribute(
accountID.getAccountPropertyBoolean(
@ -343,30 +374,22 @@ public static Object[] loadEncryptionProtocols(
boolean[] selectedEncryptions = new boolean[nbEncryptionProtocols];
// Load stored values.
int prefixeLength
= ProtocolProviderFactory.ENCRYPTION_PROTOCOL.length() + 1;
String encryptionProtocolPropertyName;
String name;
int index;
boolean enabled;
Iterator<String> encryptionProtocolNames
= encryptionProtocols.keySet().iterator();
while(encryptionProtocolNames.hasNext())
{
encryptionProtocolPropertyName = encryptionProtocolNames.next();
index = encryptionProtocols.get(encryptionProtocolPropertyName);
name = encryptionProtocolNames.next();
index = encryptionProtocols.get(name);
// If the property is set.
if(index != -1)
{
name = encryptionProtocolPropertyName.substring(prefixeLength);
if (isExistingEncryptionProtocol(name))
{
enabled = encryptionProtocolStatus.get(
ProtocolProviderFactory.ENCRYPTION_PROTOCOL_STATUS
+ "."
+ name);
encryptions[index] = name;
selectedEncryptions[index] = enabled;
selectedEncryptions[index]
= encryptionProtocolStatus.get(name);
}
}
}
@ -379,10 +402,7 @@ public static Object[] loadEncryptionProtocols(
{
encryptionProtocol = ENCRYPTION_PROTOCOLS[i];
// Specify a default value only if there is no specific value set.
if(!encryptionProtocols.containsKey(
ProtocolProviderFactory.ENCRYPTION_PROTOCOL
+ "."
+ encryptionProtocol))
if(!encryptionProtocols.containsKey(encryptionProtocol))
{
set = false;
// Search for the first empty element.

@ -6,6 +6,7 @@
*/
package net.java.sip.communicator.service.protocol.jabber;
import java.io.*;
import java.util.*;
import net.java.sip.communicator.service.credentialsstorage.*;
@ -25,12 +26,18 @@
*/
public class JabberAccountRegistration
extends JabberAccountID
implements Serializable
{
/**
* The default domain.
*/
private String defaultUserSufix;
/**
* Indicates if the password should be remembered.
*/
private boolean rememberPassword = true;
/**
* The list of additional STUN servers entered by user.
*/
@ -123,6 +130,25 @@ public void setDefaultUserSufix(String userSufix)
this.defaultUserSufix = userSufix;
}
/**
* Returns TRUE if password has to remembered, FALSE otherwise.
* @return TRUE if password has to remembered, FALSE otherwise
*/
public boolean isRememberPassword()
{
return rememberPassword;
}
/**
* Sets the rememberPassword value of this jabber account registration.
* @param rememberPassword TRUE if password has to remembered, FALSE
* otherwise
*/
public void setRememberPassword(boolean rememberPassword)
{
this.rememberPassword = rememberPassword;
}
/**
* Adds the given <tt>stunServer</tt> to the list of additional stun servers.
*
@ -209,7 +235,10 @@ public void storeProperties(String userName, String passwd,
Map<String, String> accountProperties)
throws OperationFailedException
{
setPassword(passwd);
if(rememberPassword)
setPassword(passwd);
else
setPassword(null);
String serverName = null;
if (getServerAddress() != null

@ -5,6 +5,7 @@
*/
package net.java.sip.communicator.service.protocol.sip;
import java.io.*;
import java.util.*;
import net.java.sip.communicator.service.protocol.*;
@ -25,9 +26,15 @@
*/
public class SIPAccountRegistration
extends SipAccountID
implements Serializable
{
private String defaultDomain = null;
/**
* Indicates if the password should be remembered.
*/
private boolean rememberPassword = true;
/**
* The encodings registration object.
*/
@ -72,6 +79,25 @@ public SIPAccountRegistration()
super();
}
/**
* Returns TRUE if password has to remembered, FALSE otherwise.
* @return TRUE if password has to remembered, FALSE otherwise
*/
public boolean isRememberPassword()
{
return rememberPassword;
}
/**
* Sets the rememberPassword value of this jabber account registration.
* @param rememberPassword TRUE if password has to remembered, FALSE
* otherwise
*/
public void setRememberPassword(boolean rememberPassword)
{
this.rememberPassword = rememberPassword;
}
/**
* This is the default domain.
* @return the defaultDomain
@ -163,7 +189,10 @@ public void storeProperties(String userName, String passwd,
Boolean isModification,
Map<String, String> accountProperties)
{
setPassword(passwd);
if(rememberPassword)
setPassword(passwd);
else
setPassword(null);
String serverAddress = null;
String serverFromUsername = getServerFromUserName(userName);

Loading…
Cancel
Save