Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
lenidot committed Jan 27, 2009
1 parent a9fdf3b commit b326491
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 84 deletions.
1 change: 1 addition & 0 deletions chrome.manifest
Expand Up @@ -5,6 +5,7 @@ locale zindus en-US locale/en-US/zindus/
locale zindus fr-FR locale/fr-FR/zindus/
locale zindus gl-ES locale/gl-ES/zindus/
locale zindus it-IT locale/it-IT/zindus/
locale zindus nl-NL locale/nl-NL/zindus/
locale zindus pt-BR locale/pt-BR/zindus/
skin zindus classic/1.0 skin/classic/zindus/

Expand Down
2 changes: 1 addition & 1 deletion content/zindus/configsettings.xul
Expand Up @@ -96,7 +96,7 @@
<caption label="&zindus.cs.general.actions.label;"/>
<hbox align="right" >
<button id="cs-button-test-harness" hidden="true"
align="center" command="cs-command" label="&zindus.cs.general.button.test.harness.label;" />
align="center" command="cs-command" label="Test Harness" />
<button id="cs-button-run-timer" hidden="true"
align="center" command="cs-command" label="&zindus.cs.general.button.timer.label;" />
<button id="cs-button-reset"
Expand Down
2 changes: 1 addition & 1 deletion content/zindus/const.js
Expand Up @@ -22,7 +22,7 @@
* ***** END LICENSE BLOCK *****/

const APP_NAME="zindus";
const APP_VERSION_NUMBER="0.8.5.20090123.060818"; // this line generated by build.sh
const APP_VERSION_NUMBER="0.8.5.20090127.105333"; // this line generated by build.sh
const APP_VERSION_DATA_CONSISTENT_WITH="0.8.2.20081029.145135"; // remove the data files (forcing a slow sync) if data was
// generated by a software version older than this

Expand Down
8 changes: 4 additions & 4 deletions content/zindus/filesystem.js
Expand Up @@ -31,10 +31,10 @@ var Filesystem = {
DATA : 'data' // blah\zindus\data
}),
eFilename : new ZinEnum( {
LOGFILE : 'logfile.txt',
LASTSYNC : 'lastsync.txt',
GID : 'gid.txt',
STATUS : 'status.txt'
LOGFILE : 'logfile.txt',
LASTSYNC : 'lastsync.txt',
GID : 'gid.txt',
STATUS : 'status.txt'
}),
ePerm : new ZinEnum( { // from prio.h
PR_IRUSR : 0400, // Read by owner
Expand Down
83 changes: 32 additions & 51 deletions content/zindus/observerservice.js
Expand Up @@ -21,56 +21,37 @@
*
* ***** END LICENSE BLOCK *****/

function ObserverService()
{
}

ObserverService.TOPIC_PREFERENCE_CHANGE = "ZindusPreferenceChange";

ObserverService.service = function()
{
return Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
}

ObserverService.isRegistered = function(topic)
{
var os = ObserverService.service();
var enumerator = os.enumerateObservers(topic);
var count = 0;

while (enumerator.hasMoreElements())
{
try {
var o = enumerator.getNext().QueryInterface(Components.interfaces.nsIObserver);

// dump("observerServiceIsRegistered: blah: o: " + aToString(o) + "\n");

count++;
var ObserverService = {
TOPIC_PREFERENCE_CHANGE : "ZindusPreferenceChange",
service : function() {
return Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
},
isRegistered : function(topic) {
var enumerator = this.service().enumerateObservers(topic);
var count = 0;

while (enumerator.hasMoreElements()) {
try {
let o = enumerator.getNext().QueryInterface(Ci.nsIObserver);
// dump("observerServiceIsRegistered: o: " + aToString(o) + "\n");
count++;
}
catch (e) {
zinAlert('text.alert.title', "exception while enumerating: e: " + e);
}
}
catch (e) {
zinAlert('text.alert.title', "exception while enumerating: e: " + e);
}
}

return count > 0;
}

ObserverService.notify = function(topic, subject, data)
{
ObserverService.service().notifyObservers(subject, topic, data);
}

ObserverService.register = function(obj, topic)
{
logger().debug("ObserverService.register: " + topic);

ObserverService.service().addObserver(obj, topic, false);
}

ObserverService.unregister = function(obj, topic)
{
logger().debug("ObserverService.unregister: " + topic);

ObserverService.service().removeObserver(obj, topic);
}

return count > 0;
},
notify : function(topic, subject, data) {
this.service().notifyObservers(subject, topic, data);
},
register : function(obj, topic) {
logger().debug("ObserverService.register: " + topic);
this.service().addObserver(obj, topic, false);
},
unregister : function(obj, topic) {
logger().debug("ObserverService.unregister: " + topic);
this.service().removeObserver(obj, topic);
}
};
1 change: 1 addition & 0 deletions content/zindus/singleton.js
Expand Up @@ -22,6 +22,7 @@
* ***** END LICENSE BLOCK *****/

// Handy place to keep stuff that we only ever need one of
// and for which we want to delay construction until after all .js files are loaded.
//
function singleton() {
if (typeof (singleton.m_instance) == "undefined")
Expand Down
2 changes: 2 additions & 0 deletions content/zindus/statusbar.js
Expand Up @@ -42,6 +42,8 @@
//
function StatusBar()
{
Filesystem.createDirectoriesIfRequired(); // this comes first - can't log without a directory for the logfile!

this.m_logger = newLogger("StatusBar");
this.m_timer_id = null;
this.m_timer_functor = null;
Expand Down
27 changes: 22 additions & 5 deletions content/zindus/syncfsm.js
Expand Up @@ -681,7 +681,7 @@ SyncFsm.prototype.entryActionLoadGenerator = function(state)
if (is_slow_sync && this.formatPr() == FORMAT_GD)
with (ConfigSettingsStatic)
{
removeFromPasswordDatabase(googleClientLoginUrl('use-authtoken'), "username");
removeFromPasswordDatabase("https://www.google.com/accounts/ClientLogin/AuthToken", "username");
removeFromPasswordDatabase("https://www.google.com/accounts/ClientLogin/AuthToken", this.account().username);
}
}
Expand Down Expand Up @@ -1736,8 +1736,8 @@ SyncFsm.prototype.entryActionGetContactZmSetup = function(state)

SyncFsm.GetContactZmNextBatch = function(aContact)
{
var max_contacts_in_one_request = 50;
var zuio = null;
const max_contacts_in_one_request = 50;
var zuio = null;
var a_ret = new Array();

// all contacts in the request have to be using the same zid
Expand Down Expand Up @@ -7225,6 +7225,9 @@ SyncFsm.prototype.handleXmlHttpResponse = function (continuation, context)
//
http.m_http_status_code = http.m_xhr.status;

if (false && this.state.cCallsToHttp == 2) // pretend that we got a 404 for testing
http.m_http_status_code = 404;

is_failed = (http.m_http_status_code == 0);
}
catch(e) {
Expand Down Expand Up @@ -8123,7 +8126,7 @@ SyncFsmGd.prototype.entryActionGetContactPuGd = function(state, event, continuat
let id = this.state.a_gd_contact_to_get.pop();
let url = gdAdjustHttpHttps(this.zfcPr().get(id).get(FeedItem.ATTR_SELF));

this.setupHttpGd(state, 'evRepeat', "GET", url, null, null, HttpStateGd.ON_ERROR_EVCANCEL, HttpStateGd.LOG_RESPONSE_YES);
this.setupHttpGd(state, 'evRepeat', "GET", url, null, null, HttpStateGd.ON_ERROR_EVNEXT, HttpStateGd.LOG_RESPONSE_YES);

nextEvent = 'evHttpRequest'
}
Expand All @@ -8137,17 +8140,31 @@ SyncFsmGd.prototype.entryActionGetContactPuGd = function(state, event, continuat
continuation(nextEvent);
}


SyncFsmGd.prototype.exitActionGetContactPuGd = function(state, event)
{
if (!this.state.m_http || !this.state.m_http.response() || event == "evCancel")
return;

// a 404 here is conceivable - a contact can get deleted on the server between the earlier GET and now.
// FIXME?: using v1 of the API we sometimes encountered Google's "missing tombstone" bug here, see issue#: 107
// One avenue for a workaround to Google's bug is to save some state indicating that we've encountered a 404 on a contact
// and if we encounter it a second time then it's definitely the Google bug in which case we could force a slow sync.
// Don't do anything util we get a bug report for v2.
//
if (!this.state.m_http.is_http_status(HTTP_STATUS_2xx))
{
this.state.stopFailCode = 'failon.gd.get';

// if we fail and there's no google404 key inside the sourceid_pr item of lastsync.txt, create one.
// if we fail and there's a google404 key inside the sourceid_pr item of lastsync.txt, force a slow sync
// remove the google404 key when we know we are finished (entry action above)..
//
// let zfcLastSync = new FeedCollection();
// zfcLastSync.filename(LASTSYNC);
// zfcLastSync.load();
// test for presence of sourceid_pr item...
// var account_signature = zfcLastSync.get(this.state.sourceid_pr).getOrNull('google404');
// zfcLastSync.get(sourceid_pr).set(Zuio.key('SyncToken', zid), this.state.zidbag.get(zid, 'SyncToken'));
}
else
{
Expand Down
14 changes: 6 additions & 8 deletions content/zindus/zidbag.js
Expand Up @@ -29,27 +29,25 @@

function ZidBag()
{
this.a_zid = new Array();
this.m_index = 0;
this.m_properties = new Object();
this.a_zid = new Array();
this.m_index = 0;
this.m_properties = new Object();
}

ZidBag.a_valid_properties = newObjectWithKeys(eAccount.url, 'SyncToken');

ZidBag.prototype = {
toString : function() {
var ret = "m_index: " + this.m_index + " a_zid: ";
var i, j, zid;

zinAssert(this.a_zid.length == aToLength(this.m_properties));

for (i = 0; i < this.a_zid.length; i++)
{
zid = this.a_zid[i];
for (var i = 0; i < this.a_zid.length; i++) {
let zid = this.a_zid[i];

ret += "\n " + i + ": " + strPadTo(zid, 36);

for (j in this.m_properties[zid])
for (var j in this.m_properties[zid])
ret += " " + j + ": " + this.get(zid, j);
}

Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Expand Up @@ -6,7 +6,7 @@

<em:id>{ad7d8a66-253b-11dc-977c-000c29a3126e}</em:id>

<em:version>0.8.5.20090123.060818</em:version> <!-- version populated by build script -->
<em:version>0.8.5.20090127.105333</em:version> <!-- version populated by build script -->

<em:targetApplication>
<Description>
Expand Down
1 change: 0 additions & 1 deletion locale/en-US/zindus/zindus.dtd
Expand Up @@ -48,7 +48,6 @@
<!ENTITY zindus.cs.general.button.reset.label "Reset">
<!ENTITY zindus.cs.general.button.reset.accesskey "R">
<!ENTITY zindus.cs.general.button.timer.label "Run Timer">
<!ENTITY zindus.cs.general.button.test.harness.label "Test Harness">
<!ENTITY zindus.cs.general.button.gd.advanced.label "Advanced Google Settings">
<!ENTITY zindus.cs.general.button.gd.advanced.accesskey "G">

Expand Down
6 changes: 3 additions & 3 deletions locale/nl-NL/zindus/zindus.dtd
Expand Up @@ -13,9 +13,9 @@
<!ENTITY zindus.ca.test.connection.accesskey "T">
<!ENTITY zindus.ca.google.sync.with.pab.label "Persoonlijk adressenboek">
<!ENTITY zindus.ca.google.sync.with.label "Synchroniseer Google contacts met">
<!ENTITY zindus.ca.google.suggested.contacts.label "Google Suggested Contacts">
<!ENTITY zindus.ca.google.suggested.include.label "Omvatten">
<!ENTITY zindus.ca.google.suggested.ignore.label "Negeer">
<!ENTITY zindus.ca.google.suggested.contacts.label "Aanbevolen contacten door Google">
<!ENTITY zindus.ca.google.suggested.include.label "Toevoegen">
<!ENTITY zindus.ca.google.suggested.ignore.label "Overslaan">
<!ENTITY zindus.ca.zimbra.gal.label "Algemene Adressen Lijst (GAL):">
<!ENTITY zindus.ca.zimbra.gal.yes.label "Ja">
<!ENTITY zindus.ca.zimbra.gal.no.label "Nee">
Expand Down
18 changes: 9 additions & 9 deletions update.rdf
Expand Up @@ -3,26 +3,26 @@
xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Description RDF:about="urn:mozilla:extension:{ad7d8a66-253b-11dc-977c-000c29a3126e}"
em:signature="MIGTMA0GCSqGSIb3DQEBDQUAA4GBAG+AjagM8PmCVMTK3CEohvEONJEL32DoAHmuF2EN0qR8wFpRCh2ol6WCXavgarbMCsxgzbeEQWj8EulyqS7bZC8l/zT4V1grp3dKufwXJ8QI4xCCwNhoeMJj/+3UcnHZrGMDLZECidcPjtBqnnoc0to/RSj+yK/n3ynjU1LttKDg">
em:signature="MIGTMA0GCSqGSIb3DQEBDQUAA4GBABg8i71844n3y8D0P+3nSXEFbJhKHRZsn1XAysiNofSOlws+vnjg616D/yjOewW6Ne/5cI09YgNr6r/QxfYYeyjp184nJwmw0D9qhZc4TaNW31qudX6TetyMEXiUOxcZBgij/64mzrUMML/aBUzvucJgN60ulJFDi7XYDv8ueHh9">
<em:updates RDF:resource="rdf:#$qjjRS2"/>
</RDF:Description>
<RDF:Seq RDF:about="rdf:#$qjjRS2">
<RDF:li RDF:resource="rdf:#$rjjRS2"/>
</RDF:Seq>
<RDF:Description RDF:about="rdf:#$ujjRS2"
em:id="{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}"
em:maxVersion="2.0a2"
em:minVersion="2.0a1"
em:updateLink="http://www.zindus.com/download/xpi/zindus-0.8.5.20090123.060818-tb+sm.xpi"
em:updateHash="sha256:0cdf962c2d8ac5d5898cd15cc50904addb041c53f0d96bc8c0b8173d5130a8b5" />
em:updateLink="http://www.zindus.com/download/xpi/zindus-0.8.5.20090127.105333-tb+sm.xpi"
em:updateHash="sha256:6df8cce8f249ed64a927adad9af05a1449e5edec41e5d99b3e726fb04bb36be1" />
<RDF:Seq RDF:about="rdf:#$qjjRS2">
<RDF:li RDF:resource="rdf:#$rjjRS2"/>
</RDF:Seq>
<RDF:Description RDF:about="rdf:#$BjjRS2"
em:id="{3550f703-e582-4d05-9a08-453d09bdfdc6}"
em:maxVersion="3.0b1"
em:minVersion="2.0b2"
em:updateLink="http://www.zindus.com/download/xpi/zindus-0.8.5.20090123.060818-tb+sm.xpi"
em:updateHash="sha256:0cdf962c2d8ac5d5898cd15cc50904addb041c53f0d96bc8c0b8173d5130a8b5" />
em:updateLink="http://www.zindus.com/download/xpi/zindus-0.8.5.20090127.105333-tb+sm.xpi"
em:updateHash="sha256:6df8cce8f249ed64a927adad9af05a1449e5edec41e5d99b3e726fb04bb36be1" />
<RDF:Description RDF:about="rdf:#$rjjRS2"
em:version="0.8.5.20090123.060818">
em:version="0.8.5.20090127.105333">
<em:targetApplication RDF:resource="rdf:#$ujjRS2"/>
<em:targetApplication RDF:resource="rdf:#$BjjRS2"/>
</RDF:Description>
Expand Down

0 comments on commit b326491

Please sign in to comment.