change ifdef to if else and kernel, i guess this gives the version number?

This commit is contained in:
ApfelTeeSaft
2024-10-24 15:35:22 +02:00
parent cb61076ef7
commit e46e0571c8
2 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -235,7 +235,7 @@ static plugmod_t* idaapi IDAP_init( void )
addon.id = "shigureJ.IDA.RPC";
addon.name = "IDA RPC";
addon.producer = "shigureJ";
addon.url = "https://www.github.com/offlineJ";
addon.url = "https://www.github.com/apfelteesaft";
addon.version = AUTO_VERSION_STR;
addon.freeform = "Copyright (c) 2018 shigureJ <https://keybase.io/shigurej>\n"
"All rights reserved.\n";
+9 -8
View File
@@ -1,5 +1,7 @@
#pragma once
#include "discord-rpc.h"
#include <ida.hpp>
#include <kernwin.hpp>
namespace discord_utils
{
@@ -83,15 +85,14 @@ namespace discord_utils
( g_options.timeelapsed_enabled ) ? rpc.startTimestamp = start_time : rpc.startTimestamp = NULL;
#ifdef _Release
rpc.largeImageKey = "ida";
//rpc.smallImageKey = "ida-pro";
#endif
char version[ 32 ];
get_kernel_version( version, sizeof( version ) );
#ifdef _Release64
rpc.largeImageKey = "ida";
//rpc.smallImageKey = "ida-pro64";
#endif
if ( strcmp( version, "9.0" ) >= 0 ) {
rpc.largeImageKey = "ida";
} else {
rpc.largeImageKey = "ida"; // TODO replace with other version icons
}
Discord_UpdatePresence( &rpc );
}