Berry: 'webserver.content_status_sticker' attribute parameter added (#23466)

* Berry: 'webserver.content_status_sticker' attribute parameter added

* fix optional parameter in comment
This commit is contained in:
Fabrizio Amodio 2025-05-23 22:42:59 +02:00 committed by GitHub
parent 6853e88116
commit 553ee44b02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -403,14 +403,18 @@ extern "C" {
be_raise(vm, kTypeError, nullptr);
}
// Berry: `webserver.content_status_sticker(msg:string) -> nil`
// Berry: `webserver.content_status_sticker(msg:string [,attr:string]) -> nil`
//
int32_t w_webserver_content_status_sticker(struct bvm *vm) {
#ifdef USE_WEB_STATUS_LINE
int32_t argc = be_top(vm); // Get the number of arguments
if (argc >= 1 && be_isstring(vm, 1)) {
const char * msg = be_tostring(vm, 1);
WSContentStatusSticker(msg);
const char * attr = nullptr;
if (argc >= 2 && be_isstring(vm, 2)) {
attr = be_tostring(vm, 2);
}
WSContentStatusSticker(msg, attr);
be_return_nil(vm);
}
be_raise(vm, kTypeError, nullptr);