(purple) Not all account slots are necessary

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.
This commit is contained in:
Jaidyn Ann 2021-07-19 06:41:50 -05:00
parent 3516c64ffc
commit 2d36152296

View File

@ -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);