Compare commits
	
		
			2 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 37c1482407 | ||
|  | 565eef7327 | 
| @@ -14,28 +14,29 @@ string(TIMESTAMP TIMESTAMP %s) | ||||
| # set(CMAKE_AUTOUIC ON) | ||||
|  | ||||
| find_package(Qt5 COMPONENTS Widgets) | ||||
| if (Qt5_FOUND) | ||||
| if (Qt5_FOUND AND NOT DEFINED USE_QT6) | ||||
|   message(STATUS "Using Qt 5") | ||||
|   find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets WebEngineWidgets) | ||||
|  | ||||
|   find_package(KF5Notifications) | ||||
|   if(KF5Notifications_FOUND) | ||||
|     add_definitions( -DKNOTIFICATIONS ) | ||||
|   endif() | ||||
|  | ||||
|   find_package(KF5XmlGui) | ||||
|   if(KF5XmlGui_FOUND) | ||||
|     add_definitions( -DKXMLGUI ) | ||||
|   endif() | ||||
|  | ||||
|   find_package(KF5GlobalAccel) | ||||
|   if(KF5GlobalAccel_FOUND) | ||||
|     add_definitions( -DKGLOBALACCEL ) | ||||
|   endif() | ||||
| else() | ||||
|   message(WARNING "Qt 5 was not found on your system and Qt 6 will be used. You will not be able to use any features using KDE Frameworks.") | ||||
|   message(STATUS "Using Qt 6") | ||||
|   find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets WebEngineWidgets) | ||||
| endif() | ||||
|  | ||||
| find_package(KF5Notifications) | ||||
| if(KF5Notifications_FOUND) | ||||
|   add_definitions( -DKNOTIFICATIONS ) | ||||
| endif() | ||||
|  | ||||
| find_package(KF5XmlGui) | ||||
| if(KF5XmlGui_FOUND) | ||||
|   add_definitions( -DKXMLGUI ) | ||||
| endif() | ||||
|  | ||||
| find_package(KF5GlobalAccel) | ||||
| if(KF5GlobalAccel_FOUND) | ||||
|   add_definitions( -DKGLOBALACCEL ) | ||||
| endif() | ||||
|  | ||||
| set(discord-screenaudio_SRC | ||||
|   src/main.cpp | ||||
|   src/mainwindow.cpp | ||||
|   | ||||
							
								
								
									
										5636
									
								
								assets/arrpc.js
									
									
									
									
									
								
							
							
						
						
									
										5636
									
								
								assets/arrpc.js
									
									
									
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -1 +1,65 @@ | ||||
| setTimeout((i=>{let t,a,s,e={};new WebSocket("ws://127.0.0.1:1337").onmessage=async i=>{if(msg=JSON.parse(i.data),console.log(msg),!t){const i=window.webpackChunkdiscord_app.push([[Symbol()],{},i=>i]),e=i.c;window.webpackChunkdiscord_app.pop();for(const i in e){let a=e[i].exports;if(a=a&&(a.Z??a.ZP),a&&a.register&&a.wait){t=a;break}}const n=i.m;for(const t in n)if(n[t].toString().includes("getAssetImage: size must === [number, number] for Twitch")){const s=i(t),e=Object.values(s).find((i=>"function"==typeof i&&i.toString().includes("apply(")));a=async(i,t)=>(await e(i,[t,void 0]))[0];break}for(const t in n)if(n[t].toString().includes("e.application={")){const a=i(t),e=Object.values(a).find((i=>"function"==typeof i&&i.toString().includes("e.application={")));s=async i=>{let t={};return await e(t,i),t.application};break}}if(msg.activity?.assets?.large_image&&(msg.activity.assets.large_image=await a(msg.activity.application_id,msg.activity.assets.large_image)),msg.activity?.assets?.small_image&&(msg.activity.assets.small_image=await a(msg.activity.application_id,msg.activity.assets.small_image)),msg.activity){const i=msg.activity.application_id;e[i]||(e[i]=await s(i));const t=e[i];msg.activity.name||(msg.activity.name=t.name)}t.dispatch({type:"LOCAL_ACTIVITY_UPDATE",...msg})}}),1e4); | ||||
| setTimeout(e => { | ||||
|     let Dispatcher, lookupAsset, lookupApp, apps = {}; | ||||
|  | ||||
|     const ws = new WebSocket('ws://127.0.0.1:1337'); // connect to arRPC bridge websocket | ||||
|     ws.onmessage = async x => { | ||||
|         msg = JSON.parse(x.data); | ||||
|         console.log(msg); | ||||
|  | ||||
|         if (!Dispatcher) { | ||||
|             const wpRequire = window.webpackChunkdiscord_app.push([[Symbol()], {}, x => x]); | ||||
|             const cache = wpRequire.c; | ||||
|             window.webpackChunkdiscord_app.pop(); | ||||
|  | ||||
|             for (const id in cache) { | ||||
|                 let mod = cache[id].exports; | ||||
|                 mod = mod && (mod.Z ?? mod.ZP); | ||||
|  | ||||
|                 if (mod && mod.register && mod.wait) { | ||||
|                     Dispatcher = mod; | ||||
|                     break; | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             const factories = wpRequire.m; | ||||
|             for (const id in factories) { | ||||
|                 if (factories[id].toString().includes('getAssetImage: size must === [number, number] for Twitch')) { | ||||
|                     const mod = wpRequire(id); | ||||
|  | ||||
|                     const _lookupAsset = Object.values(mod).find(e => typeof e === "function" && e.toString().includes("apply(")); | ||||
|                     lookupAsset = async (appId, name) => (await _lookupAsset(appId, [name, undefined]))[0]; | ||||
|  | ||||
|                     break; | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             for (const id in factories) { | ||||
|                 if (factories[id].toString().includes(`e.application={`)) { | ||||
|                     const mod = wpRequire(id); | ||||
|  | ||||
|                     const _lookupApp = Object.values(mod).find(e => typeof e === "function" && e.toString().includes(`e.application={`)); | ||||
|                     lookupApp = async appId => { | ||||
|                         let socket = {}; | ||||
|                         await _lookupApp(socket, appId); | ||||
|                         return socket.application; | ||||
|                     }; | ||||
|  | ||||
|                     break; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if (msg.activity?.assets?.large_image) msg.activity.assets.large_image = await lookupAsset(msg.activity.application_id, msg.activity.assets.large_image); | ||||
|         if (msg.activity?.assets?.small_image) msg.activity.assets.small_image = await lookupAsset(msg.activity.application_id, msg.activity.assets.small_image); | ||||
|  | ||||
|         if (msg.activity) { | ||||
|             const appId = msg.activity.application_id; | ||||
|             if (!apps[appId]) apps[appId] = await lookupApp(appId); | ||||
|  | ||||
|             const app = apps[appId]; | ||||
|             if (!msg.activity.name) msg.activity.name = app.name; | ||||
|         } | ||||
|  | ||||
|         Dispatcher.dispatch({ type: "LOCAL_ACTIVITY_UPDATE", ...msg }); // set RPC status | ||||
|     }; | ||||
| }, 10000) | ||||
| @@ -30,7 +30,7 @@ echo_status "Patching arRPC" | ||||
| sed -i 's/"type": "module",//' package.json | ||||
|  | ||||
| echo_status "Building arRPC" | ||||
| pnpm exec ncc build -m src/index.js | ||||
| pnpm exec ncc build src/index.js | ||||
|  | ||||
| echo_status "Copying built file" | ||||
| cp -v ./dist/index.js ../../assets/arrpc.js | ||||
|   | ||||
| @@ -11,7 +11,6 @@ | ||||
| CentralWidget::CentralWidget(QWidget *parent) : QWidget(parent) { | ||||
|   setStyleSheet("background-color:#313338;"); | ||||
|   m_layout = new QVBoxLayout(this); | ||||
|   m_layout->setMargin(0); | ||||
|   m_layout->setSpacing(0); | ||||
|   setupWebView(); | ||||
| } | ||||
|   | ||||
| @@ -30,7 +30,6 @@ MainWindow::MainWindow(bool useNotifySend, QWidget *parent) | ||||
|   m_centralWidget = new CentralWidget(this); | ||||
|   setCentralWidget(m_centralWidget); | ||||
|   setupTrayIcon(); | ||||
|   setMinimumSize(800, 300); | ||||
|   if (m_settings->contains("geometry")) { | ||||
|     restoreGeometry(m_settings->value("geometry").toByteArray()); | ||||
|   } else { | ||||
|   | ||||
| @@ -44,10 +44,6 @@ void UserScript::setupHelpMenu() { | ||||
|       QString(), "https://github.com/Curve"); | ||||
|   aboutData.addComponent("Rohrkabel", "A C++ RAII Pipewire-API Wrapper", "1.3", | ||||
|                          "https://github.com/Soundux/rohrkabel"); | ||||
|   aboutData.addComponent("arRPC", | ||||
|                          "An open implementation of Discord's local RPC " | ||||
|                          "servers<br>Copyright (c) 2022 OpenAsar", | ||||
|                          nullptr, "https://github.com/OpenAsar/arrpc"); | ||||
|   m_helpMenu = new KHelpMenu(MainWindow::instance(), aboutData); | ||||
| #endif | ||||
| } | ||||
|   | ||||
| @@ -99,7 +99,7 @@ void start(QString _target) { | ||||
|     } | ||||
|   }; | ||||
|  | ||||
|   std::string target = _target.toUtf8().toStdString(); | ||||
|   std::string target = _target.toLatin1().toStdString(); | ||||
|  | ||||
|   auto virtual_mic = core.create("adapter", | ||||
|                                  {{"node.name", "discord-screenaudio-virtmic"}, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user