From fb1c7a38cebf669b5fae6c86be2a8f7268cbf2dc Mon Sep 17 00:00:00 2001 From: Daniel Borkan Date: Mon, 28 Sep 2015 13:43:51 -0400 Subject: [PATCH 1/3] Notify existing users that Google and Facebook social networks have changed --- src/generic_core/globals.ts | 5 ++++- src/generic_core/uproxy_core.ts | 12 ++++++++++-- src/generic_ui/locales/en/messages.json | 4 ++++ src/generic_ui/polymer/root.html | 19 +++++++++++++++++++ src/generic_ui/polymer/root.ts | 11 +++++++++++ src/generic_ui/scripts/ui.ts | 3 ++- src/interfaces/uproxy_core_api.ts | 1 + 7 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/generic_core/globals.ts b/src/generic_core/globals.ts index 1fb9bf2b02..94a3517fcc 100644 --- a/src/generic_core/globals.ts +++ b/src/generic_core/globals.ts @@ -41,7 +41,10 @@ export var settings :uproxy_core_api.GlobalSettings = { statsReportingEnabled: false, consoleFilter: loggingTypes.Level.warn, language: 'en', - force_message_version: 0 // zero means "don't override" + force_message_version: 0, // zero means "don't override" + // TODO: remove this in November 2015, to allow 1 month for existing users to + // see the notification that Google+Facebook social providers have changed. + hasSeenGoogleAndFacebookChangedNotification: false }; export var natType :string = ''; diff --git a/src/generic_core/uproxy_core.ts b/src/generic_core/uproxy_core.ts index 71b7749dae..49b34243fa 100644 --- a/src/generic_core/uproxy_core.ts +++ b/src/generic_core/uproxy_core.ts @@ -70,8 +70,14 @@ export class uProxyCore implements uproxy_core_api.CoreApi { var logins :Promise[] = []; for (var i in networks) { + var networkName = networks[i] + if (!(networkName in social_network.networks)) { + // Network may have been removed, e.g. old "Facebook" network is now + // "Facebook-Firebase-V2". + continue; + } logins.push(this.login({ - network: networks[i], + network: networkName, reconnect: true, }).catch(() => { // any failure to login should just be ignored - the user will either @@ -226,9 +232,11 @@ export class uProxyCore implements uproxy_core_api.CoreApi { globals.settings.consoleFilter); globals.settings.language = newSettings.language; globals.settings.force_message_version = newSettings.force_message_version; + globals.settings.hasSeenGoogleAndFacebookChangedNotification = + newSettings.hasSeenGoogleAndFacebookChangedNotification; } - public getFullState = () :Promise => { + public getFullState = () :Promise => { return globals.loadSettings.then(() => { var copyPasteConnectionState = copyPasteConnection.getCurrentState(); diff --git a/src/generic_ui/locales/en/messages.json b/src/generic_ui/locales/en/messages.json index 3bc8b38f0b..d77b66ff7f 100644 --- a/src/generic_ui/locales/en/messages.json +++ b/src/generic_ui/locales/en/messages.json @@ -818,5 +818,9 @@ "INVITE_EMAIL_BODY": { "description": "Default email body for sending an uProxy invite", "message": "__name__ has invited you to connect with him on uProxy. To do so, click on the invitation link below or paste it into uProxy.

__url__

If you don’t have uProxy installed, you can get it from uproxy.org or directly from the Chrome webstore (part 1 and part 2) and Firefox Marketplace (here)." + }, + "GOOGLE_AND_FACEBOOK_CHANGED_NOTIFICATION": { + "description": "", + "message": "

We've made big changes to how uProxy works with social networks!

  • We've introduced a new Gmail network that allows you to connect with anyone who has a Gmail account. Use the the button in the lower right of the buddy list to send them an invitation.
  • The \"Google\" network is now called Google Hangouts. Because Google is removing technology we rely on, our support for this network is being sunset.
  • Facebook contacts are now added by invitation. You can invite friends using the button at the lower right of the contact list, and only friends you've invited will be able to tell you're using uProxy. To make this change, we've had to reset your friend list, so you'll have to invite friends you want to connect to.

Please send feedback about these changes using the feedback link in the menu or by emailing info@uProxy.org

" } } diff --git a/src/generic_ui/polymer/root.html b/src/generic_ui/polymer/root.html index 932b2c99f9..d68cdd787b 100644 --- a/src/generic_ui/polymer/root.html +++ b/src/generic_ui/polymer/root.html @@ -255,6 +255,16 @@ width: 56px; padding: 15px; } + #googleAndFacebookChangedOverlay { + background-color: white; + height: 100%; + width: 100%; + padding: 2em; + line-height: 20px; + } + #googleAndFacebookChangedOverlay ul li { + margin-top: 1em; + } @@ -278,6 +288,15 @@ + +
+ +
+
+ OK +
+
+ diff --git a/src/generic_ui/polymer/root.ts b/src/generic_ui/polymer/root.ts index f2560e0b5d..ddb75f5a4b 100644 --- a/src/generic_ui/polymer/root.ts +++ b/src/generic_ui/polymer/root.ts @@ -68,6 +68,9 @@ Polymer({ ui.setMode(ui_types.Mode.SHARE); }, closedWelcome: function() { + // New users (who have just completed the welcome screen) will not need + // to see the Google and Facebook changed notification. + model.globalSettings.hasSeenGoogleAndFacebookChangedNotification = true; model.globalSettings.hasSeenWelcome = true; core.updateGlobalSettings(model.globalSettings); }, @@ -78,6 +81,14 @@ Polymer({ dismissCopyPasteError: function() { ui.copyPasteError = ui_types.CopyPasteError.NONE; }, + googleAndFacebookChangedNotificationOpened: function() { + this.$.googleAndFacebookChangedNotificationContent.innerHTML = + ui.i18n_t("GOOGLE_AND_FACEBOOK_CHANGED_NOTIFICATION"); + }, + dismissGoogleAndFacebookChangedNotification: function() { + model.globalSettings.hasSeenGoogleAndFacebookChangedNotification = true; + core.updateGlobalSettings(model.globalSettings); + }, openDialog: function(e :Event, detail :dialog_description) { /* 'detail' parameter holds the data that was passed when the open-dialog * signal was fired. It should be of the form: diff --git a/src/generic_ui/scripts/ui.ts b/src/generic_ui/scripts/ui.ts index 27b3eba3c7..8c0b35509b 100644 --- a/src/generic_ui/scripts/ui.ts +++ b/src/generic_ui/scripts/ui.ts @@ -62,7 +62,8 @@ export class Model { statsReportingEnabled: false, consoleFilter: 2, // loggingTypes.Level.warn language: 'en', - force_message_version: 0 + force_message_version: 0, + hasSeenGoogleAndFacebookChangedNotification: false }; public reconnecting = false; diff --git a/src/interfaces/uproxy_core_api.ts b/src/interfaces/uproxy_core_api.ts index 9b8b19a520..2afec7dd2d 100644 --- a/src/interfaces/uproxy_core_api.ts +++ b/src/interfaces/uproxy_core_api.ts @@ -35,6 +35,7 @@ export interface GlobalSettings { consoleFilter :loggingTypes.Level; language :string; force_message_version :number; + hasSeenGoogleAndFacebookChangedNotification :boolean; } export interface InitialState { networkNames :string[]; From 7b77a47e4c3a84495185acf473266401edd1e392 Mon Sep 17 00:00:00 2001 From: Daniel Borkan Date: Mon, 28 Sep 2015 13:47:12 -0400 Subject: [PATCH 2/3] Remove extra space --- src/generic_core/uproxy_core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic_core/uproxy_core.ts b/src/generic_core/uproxy_core.ts index 49b34243fa..079fa6fdf4 100644 --- a/src/generic_core/uproxy_core.ts +++ b/src/generic_core/uproxy_core.ts @@ -236,7 +236,7 @@ export class uProxyCore implements uproxy_core_api.CoreApi { newSettings.hasSeenGoogleAndFacebookChangedNotification; } - public getFullState = () :Promise => { + public getFullState = () :Promise => { return globals.loadSettings.then(() => { var copyPasteConnectionState = copyPasteConnection.getCurrentState(); From b917398d15e987c70e7c344153bf11adc08593b4 Mon Sep 17 00:00:00 2001 From: Daniel Borkan Date: Mon, 28 Sep 2015 14:16:49 -0400 Subject: [PATCH 3/3] Update translations --- src/generic_ui/locales/en/messages.json | 2 +- src/generic_ui/polymer/root.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic_ui/locales/en/messages.json b/src/generic_ui/locales/en/messages.json index d77b66ff7f..0acf5c9f13 100644 --- a/src/generic_ui/locales/en/messages.json +++ b/src/generic_ui/locales/en/messages.json @@ -821,6 +821,6 @@ }, "GOOGLE_AND_FACEBOOK_CHANGED_NOTIFICATION": { "description": "", - "message": "

We've made big changes to how uProxy works with social networks!

  • We've introduced a new Gmail network that allows you to connect with anyone who has a Gmail account. Use the the button in the lower right of the buddy list to send them an invitation.
  • The \"Google\" network is now called Google Hangouts. Because Google is removing technology we rely on, our support for this network is being sunset.
  • Facebook contacts are now added by invitation. You can invite friends using the button at the lower right of the contact list, and only friends you've invited will be able to tell you're using uProxy. To make this change, we've had to reset your friend list, so you'll have to invite friends you want to connect to.

Please send feedback about these changes using the feedback link in the menu or by emailing info@uProxy.org

" + "message": "

We've made big changes to how uProxy works with social networks!

  • We've introduced a new Gmail network that allows you to connect with anyone who has a Gmail account. Use the the button in the lower right of the buddy list to send them an invitation.
  • The \"Google\" network is now called Google Hangouts. Because Google is removing technology we rely on, our support for this network will be removed.
  • Facebook contacts are now added by invitation. You can invite friends using the button at the lower right of the contact list, and only friends you've invited will be able to tell you're using uProxy. To make this change, we've had to reset your friend list, so you'll have to invite friends you want to connect to.

Please send feedback about these changes using the feedback link in the menu or by emailing info@uProxy.org

" } } diff --git a/src/generic_ui/polymer/root.html b/src/generic_ui/polymer/root.html index d68cdd787b..ac164f29e4 100644 --- a/src/generic_ui/polymer/root.html +++ b/src/generic_ui/polymer/root.html @@ -293,7 +293,7 @@
- OK + {{ "OK" | $$ }}