chore: remove Singleton & replace getIApp with getApp (#5514)

This commit is contained in:
pajlada
2024-07-21 15:09:59 +02:00
committed by GitHub
parent 21186df058
commit 5deec1f02f
145 changed files with 802 additions and 856 deletions
+3 -3
View File
@@ -174,7 +174,7 @@ int ChannelRef::send_message(lua_State *L)
text = text.replace('\n', ' ');
if (execcmds)
{
text = getIApp()->getCommands()->execCommand(text, that, false);
text = getApp()->getCommands()->execCommand(text, that, false);
}
that->sendMessage(text);
return 0;
@@ -300,7 +300,7 @@ int ChannelRef::get_by_name(lua_State *L)
lua_pushnil(L);
return 1;
}
auto chn = getIApp()->getTwitchAbstract()->getChannelOrEmpty(name);
auto chn = getApp()->getTwitchAbstract()->getChannelOrEmpty(name);
lua::push(L, chn);
return 1;
}
@@ -324,7 +324,7 @@ int ChannelRef::get_by_twitch_id(lua_State *L)
lua_pushnil(L);
return 1;
}
auto chn = getIApp()->getTwitch()->getChannelOrEmptyByID(id);
auto chn = getApp()->getTwitch()->getChannelOrEmptyByID(id);
lua::push(L, chn);
return 1;
+1 -1
View File
@@ -309,7 +309,7 @@ int HTTPRequest::create(lua_State *L)
L, "cannot get method (1st argument of HTTPRequest.create, "
"expected a string)");
}
auto *pl = getIApp()->getPlugins()->getPluginByStatePtr(L);
auto *pl = getApp()->getPlugins()->getPluginByStatePtr(L);
if (!pl->hasHTTPPermissionFor(parsedurl))
{
return luaL_error(