From 2d3615229685c507ddec50151a29064102ec7be8 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Mon, 19 Jul 2021 06:41:50 -0500 Subject: [PATCH] (purple) Not all account slots are necessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since libpurple doesn't mark individual account settings as "required" or not (Pidgin will accept account settings even with all-blank answers, unlike Cardie), every setting was marked as required by Cardie, just to err on the side of caution. But that's not necessary now, and was bad to begin with (especially for Jabber, etc, with superfluous options)― in the case of libpurple, we can follow Pidgin's example. Cardie will accept account settings with mostly-blank options, but the add-on will send an error (and disable the account) when it doesn't work. --- protocols/purple/PurpleApp.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/protocols/purple/PurpleApp.cpp b/protocols/purple/PurpleApp.cpp index 737642e..0d083ae 100644 --- a/protocols/purple/PurpleApp.cpp +++ b/protocols/purple/PurpleApp.cpp @@ -587,6 +587,11 @@ PurpleApp::_GetAccountTemplate(PurplePluginProtocolInfo* info) setting.AddString("description", BString(_tr(split->text)).Append(":")); setting.AddString("default", split->default_value); setting.AddInt32("type", B_STRING_TYPE); + + BString error(B_TRANSLATE("%name% needs to be specified.")); + error.ReplaceAll("%name%", _tr(split->text)); + setting.AddString("error", error); + temp.AddMessage("setting", &setting); } @@ -646,11 +651,6 @@ PurpleApp::_GetAccountTemplate(PurplePluginProtocolInfo* info) if (pref->masked) setting.AddBool("is_hidden", true); - - BString error(B_TRANSLATE("%name% needs to be specified.")); - error.ReplaceAll("%name%", pref->text); - setting.AddString("error", error); - setting.AddInt32("type", bType); setting.AddString("description", description); temp.AddMessage("setting", &setting);