Merge branch 'master' of github.com:jitsi/jitsi

cusax-fix
Boris Grozev 13 years ago
commit 0624917501

2
.gitignore vendored

@ -3,3 +3,5 @@ classes
sc-bundles
.gitignore.swp
*.iws
.gitignore
jitsi.iml

@ -356,6 +356,7 @@ service.gui.NO_CONTACTS_FOUND=No matching contacts found. Press Ctrl+Enter to ca
service.gui.NO_CONTACTS_FOUND_SHORT=No matching contacts found.
service.gui.NO_MESSAGE=No message
service.gui.NO_GROUP_CHAT_ACCOUNT_AVAILABLE=No accounts, supporting multi user chat found. Check jitsi.org for more information on which protocols support multi user chat.
service.gui.NO_ONLINE_CONFERENCING_ACCOUNT=No available conferencing account. Check https://jitsi.org for more information on which protocols support conferencing.
service.gui.NO_ONLINE_TELEPHONY_ACCOUNT=At least one online telephony account is needed in order to make a call. Please login to one of your telephony accounts and try again.
service.gui.NOT_AUTHORIZED=Not authorized
service.gui.NON_EMPTY_CHAT_WINDOW_CLOSE=You're trying to close a chat with a non-sent message. Are you sure you want to close this chat?
@ -1171,14 +1172,14 @@ plugin.autoaway.ENABLE_CHANGE_STATUS=Change status while away
plugin.autoaway.AWAY_MINUTES=Minutes before switching to away:
# updatechecker
plugin.updatechecker.DIALOG_TITLE=New version available
plugin.updatechecker.DIALOG_TITLE=Install Updates
plugin.updatechecker.DIALOG_MESSAGE=<html>A new version of {0} is available for download.
plugin.updatechecker.DIALOG_MESSAGE_2=<br>{0} ({1}): <br>
plugin.updatechecker.BUTTON_DOWNLOAD=Download
plugin.updatechecker.BUTTON_CLOSE=Close
plugin.updatechecker.BUTTON_INSTALL=Install
plugin.updatechecker.UPDATE_MENU_ENTRY=Check for updates
plugin.updatechecker.DIALOG_WARN=If you continue with update application will be shutdown! Are you sure?
plugin.updatechecker.DIALOG_WARN={0} needs to quit before it can install updates. Any conversations or calls will disconnect temporarily. Should {0} continue to install updates?
plugin.updatechecker.DIALOG_NOUPDATE=Your version is up to date.
plugin.updatechecker.DIALOG_NOUPDATE_TITLE=No new version
plugin.updatechecker.DIALOG_MISSING_UPDATE=Update Installer is missing.

@ -36,7 +36,7 @@ public class VersionImpl
* number changes when a relatively extensive set of new features and
* possibly rearchitecturing have been applied to the Jitsi.
*/
public static final int VERSION_MINOR = 2;
public static final int VERSION_MINOR = 3;
/**
* The version minor field. Default value is VERSION_MINOR.

@ -85,6 +85,7 @@ static void remove(ThunderbirdContactSourceService service)
registrations.get(service).unregister();
registrations.remove(service);
ConfigurationService config = getConfigService();
config.removeProperty(service.getBaseConfigProperty());
for (String prop : config.getPropertyNamesByPrefix(
service.getBaseConfigProperty(), false))
{
@ -110,7 +111,8 @@ public void start(BundleContext bundleContext) throws Exception
<ThunderbirdContactSourceService, ServiceRegistration>();
for (String cfg : configs)
{
if (cfg.endsWith(config.getString(cfg)))
String value = config.getString(cfg);
if (value != null && cfg.endsWith(value))
{
add(cfg);
}

@ -82,6 +82,7 @@ private void initComponents()
pnl.add(lblPrefix);
txtPrefix = new JTextField();
txtPrefix.getDocument().addDocumentListener(this);
pnl.add(txtPrefix);
List<ThunderbirdContactSourceService> activeServices
@ -309,7 +310,9 @@ public boolean isAdvanced()
* DocumentEvent)
*/
public void insertUpdate(DocumentEvent e)
{}
{
changedUpdate(e);
}
/*
* (non-Javadoc)
@ -318,7 +321,9 @@ public void insertUpdate(DocumentEvent e)
* DocumentEvent)
*/
public void removeUpdate(DocumentEvent e)
{}
{
changedUpdate(e);
}
/*
* (non-Javadoc)

@ -50,77 +50,87 @@ public ThunderbirdContactQuery(ThunderbirdContactSourceService owner,
@Override
protected void run()
{
String file = super.getContactSource().getFilename();
String filename = super.getContactSource().getFilename();
File file = new File(filename);
try
{
// parse the Thunderbird Mork database
InputStreamReader sr =
new InputStreamReader(new FileInputStream(file));
MorkDocument md = new MorkDocument(sr);
sr.close();
// We now have rows in their tables and additional rows at
// transaction level. Put the to a better format:
// DB -> Tables -> Rows
Map<String, Map<String, Row>> db =
new HashMap<String, Map<String, Row>>();
for (Table t : md.getTables())
if (file.lastModified() > getContactSource().lastDatabaseFileChange)
{
String tableId = t.getTableId() + "/" + t.getScopeName();
Map<String, Row> table = db.get(tableId);
if (table == null)
// parse the Thunderbird Mork database
InputStreamReader sr =
new InputStreamReader(new FileInputStream(filename));
MorkDocument md = new MorkDocument(sr);
sr.close();
// We now have rows in their tables and additional rows at
// transaction level. Put the to a better format:
// DB -> Tables -> Rows
Map<String, Map<String, Row>> db =
new HashMap<String, Map<String, Row>>();
for (Table t : md.getTables())
{
table = new HashMap<String, Row>();
db.put(tableId, table);
String tableId = t.getTableId() + "/" + t.getScopeName();
Map<String, Row> table = db.get(tableId);
if (table == null)
{
table = new HashMap<String, Row>();
db.put(tableId, table);
}
for (Row r : t.getRows())
{
String scope = r.getScopeName();
if (scope == null)
{
scope = t.getScopeName();
}
table.put(r.getRowId() + "/" + scope, r);
}
}
for (Row r : t.getRows())
// The additional rows at the root-level update/replace the ones
// in the tables. There's usually neither a table nor a scope
// defined, so lets just use the default.
String defaultScope = md.getDicts().get(0).dereference("^80");
for (Row r : md.getRows())
{
String scope = r.getScopeName();
if (scope == null)
{
scope = t.getScopeName();
scope = defaultScope;
}
table.put(r.getRowId() + "/" + scope, r);
}
}
// The additional rows at the root-level update/replace the ones in
// the tables. There's usually neither a table nor a scope defined,
// so lets just use the default.
String defaultScope = md.getDicts().get(0).dereference("^80");
for (Row r : md.getRows())
{
String scope = r.getScopeName();
if (scope == null)
{
scope = defaultScope;
}
String tableId = "1/" + scope;
Map<String, Row> table = db.get(tableId);
if (table == null)
{
table = new HashMap<String, Row>();
db.put(tableId, table);
}
String rowId = r.getRowId() + "/" + scope;
if (rowId.startsWith("-"))
{
rowId = rowId.substring(1);
String tableId = "1/" + scope;
Map<String, Row> table = db.get(tableId);
if (table == null)
{
table = new HashMap<String, Row>();
db.put(tableId, table);
}
String rowId = r.getRowId() + "/" + scope;
if (rowId.startsWith("-"))
{
rowId = rowId.substring(1);
}
table.put(rowId, r);
}
table.put(rowId, r);
super.getContactSource().database = db;
super.getContactSource().defaultScope = defaultScope;
super.getContactSource().lastDatabaseFileChange =
file.lastModified();
}
// okay, "transactions" are applied, now perform the search
for (Entry<String, Map<String, Row>> table : db.entrySet())
for (Entry<String, Map<String, Row>> table
: super.getContactSource().database.entrySet())
{
for (Map.Entry<String, Row> e : table.getValue().entrySet())
{
if (e.getKey().endsWith(defaultScope))
if (e.getKey().endsWith(getContactSource().defaultScope))
{
readEntry(e.getValue());
}

@ -6,10 +6,12 @@
*/
package net.java.sip.communicator.plugin.thunderbird;
import java.util.Map;
import java.util.regex.*;
import org.jitsi.service.configuration.*;
import mork.Row;
import net.java.sip.communicator.service.contactsource.*;
/**
@ -72,6 +74,19 @@ public class ThunderbirdContactSourceService
/** Value of property {@link #PNAME_PREFIX} */
private String prefix;
/** Date/time when the Thunderbird database file was last changed. */
long lastDatabaseFileChange = 0;
/**
* The parsed Thunderbird database. This field is used as a cache and set by
* the query. It is re-set when the file date is newer than
* {@link #lastDatabaseFileChange}
*/
Map<String, Map<String, Row>> database;
/** Name of the default namespace in the Thunderbird database. */
String defaultScope;
/**
* Creates a new instance of this class.
*

@ -999,7 +999,11 @@ private static void windowsUpdate()
if(UpdateActivator.getUIService()
.getPopupDialog().showConfirmPopupDialog(
resources.getI18NString(
"plugin.updatechecker.DIALOG_WARN"),
"plugin.updatechecker.DIALOG_WARN",
new String[]{
resources.getSettingsString(
"service.gui.APPLICATION_NAME")
}),
resources.getI18NString(
"plugin.updatechecker.DIALOG_TITLE"),
PopupDialog.YES_NO_OPTION,

@ -463,6 +463,15 @@ public abstract class ProtocolProviderFactory
*/
public static final String ENCODING_PROP_PREFIX = "Encodings";
/**
* An account property to provide a connected account to check for
* its status. Used when the current provider need to reject calls
* but is missing presence operation set and need to check other
* provider for status.
*/
public static final String CUSAX_PROVIDER_ACCOUNT_PROP
= "cusax.XMPP_ACCOUNT_ID";
/**
* The <code>BundleContext</code> containing (or to contain) the service
* registration of this factory.

@ -55,15 +55,6 @@ public class SingleCallInProgressPolicy
= "net.java.sip.communicator.impl.protocol."
+ ACCOUNT_PROPERTY_REJECT_IN_CALL_ON_DND;
/**
* An account property to provide a connected account to check for
* its status. Used when the current provider need to reject calls
* but is missing presence operation set and need to check other
* provider for status.
*/
private static final String CUSAX_PROVIDER_ACCOUNT_PROP
= "cusax.xmppAccountID";
/**
* Implements the listeners interfaces used by this policy.
*/
@ -396,7 +387,8 @@ private void handleCallEvent(int type, CallEvent callEvent)
// there is no presence opset let's check
// the connected cusax provider if available
String cusaxProviderID = provider.getAccountID()
.getAccountPropertyString(CUSAX_PROVIDER_ACCOUNT_PROP);
.getAccountPropertyString(
ProtocolProviderFactory.CUSAX_PROVIDER_ACCOUNT_PROP);
AccountID acc =
ProtocolProviderActivator.getAccountManager()

Loading…
Cancel
Save