summary refs log tree commit diff stats
path: root/plugins/sysinfo
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2012-10-21 12:49:55 +0200
committerBerke Viktor <bviktor@hexchat.org>2012-10-21 12:49:55 +0200
commit1e7d7101c612da4d1c21abdff85d8fe8e40e4416 (patch)
tree070f75a64fa55c31acbc85a9fb6e6d584a96bb2a /plugins/sysinfo
parentd9dc34499dce40e115ed73664fb518e4c8bf6620 (diff)
Some more cleanup for SysInfo
Diffstat (limited to 'plugins/sysinfo')
-rw-r--r--plugins/sysinfo/xsys.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/plugins/sysinfo/xsys.c b/plugins/sysinfo/xsys.c
index ef799bb9..27669650 100644
--- a/plugins/sysinfo/xsys.c
+++ b/plugins/sysinfo/xsys.c
@@ -578,13 +578,13 @@ netdata_cb (char *word[], char *word_eol[], void *userdata)
 	xchat_pluginpref_get_str (ph, "format", format);
 	format_output ("Netdata", netdata, format);
 
-	if ((long)userdata)
+	if (xchat_list_int (ph, NULL, "type") >= 2)
 	{
-		xchat_printf (ph, "%s", netdata);
+		xchat_commandf (ph, "ME %s", netdata);
 	}
 	else
 	{
-		xchat_commandf (ph, "say %s", netdata);
+		xchat_printf (ph, "%s", netdata);
 	}
 	
 	return XCHAT_EAT_ALL;
@@ -651,13 +651,13 @@ netstream_cb (char *word[], char *word_eol[], void *userdata)
 	xchat_pluginpref_get_str (ph, "format", format);
 	format_output ("Netstream", netstream, format);
 
-	if ((long)userdata)
+	if (xchat_list_int (ph, NULL, "type") >= 2)
 	{
-		xchat_printf (ph, "%s", netstream);
+		xchat_commandf (ph, "ME %s", netstream);
 	}
 	else
 	{
-		xchat_commandf (ph, "say %s", netstream);
+		xchat_printf (ph, "%s", netstream);
 	}
 
 	return XCHAT_EAT_ALL;
@@ -746,11 +746,9 @@ xchat_plugin_init (xchat_plugin *plugin_handle, char **plugin_name, char **plugi
 	*plugin_version = version;
 	char buffer[bsize];
 
-	xchat_hook_command (ph, "SYSINFO",    XCHAT_PRI_NORM, sysinfo_cb,   "Usage: /SYSINFO [OS|DISTRO|CPU|RAM|DISK|VGA|SOUND|ETHERNET|UPTIME]", 0);
-	xchat_hook_command (ph, "NETDATA",    XCHAT_PRI_NORM, netdata_cb,   NULL, (void *) 0);
-	xchat_hook_command (ph, "ENETDATA",   XCHAT_PRI_NORM, netdata_cb,   NULL, (void *) 1);
-	xchat_hook_command (ph, "NETSTREAM",  XCHAT_PRI_NORM, netstream_cb, NULL, (void *) 0);
-	xchat_hook_command (ph, "ENETSTREAM", XCHAT_PRI_NORM, netstream_cb, NULL, (void *) 1);
+	xchat_hook_command (ph, "SYSINFO",	XCHAT_PRI_NORM,	sysinfo_cb,	"Usage: /SYSINFO [OS|DISTRO|CPU|RAM|DISK|VGA|SOUND|ETHERNET|UPTIME]", NULL);
+	xchat_hook_command (ph, "SYSNETDATA",	XCHAT_PRI_NORM,	netdata_cb,	NULL, NULL);
+	xchat_hook_command (ph, "SYSNETSTREAM",	XCHAT_PRI_NORM,	netstream_cb,	NULL, NULL);
 
 	/* this is required for the very first run */
 	if (xchat_pluginpref_get_str (ph, "pciids", buffer) == 0)