aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--protocols/purple/purple.c15
-rw-r--r--root_commands.c11
2 files changed, 25 insertions, 1 deletions
diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c
index 8b3b8c7c..49c1ee7c 100644
--- a/protocols/purple/purple.c
+++ b/protocols/purple/purple.c
@@ -1640,6 +1640,10 @@ static void purple_ui_init()
}
}
+/* borrowing this semi-private function
+ * TODO: figure out a better interface later (famous last words) */
+gboolean plugin_info_add(struct plugin_info *info);
+
void purple_initmodule()
{
struct prpl funcs;
@@ -1740,6 +1744,7 @@ void purple_initmodule()
PurplePlugin *prot = prots->data;
PurplePluginProtocolInfo *pi = prot->info->extra_info;
struct prpl *ret;
+ struct plugin_info *info;
/* If we already have this one (as a native module), don't
add a libpurple duplicate. */
@@ -1774,6 +1779,16 @@ void purple_initmodule()
ret->data = NULL;
register_protocol(ret);
}
+
+ info = g_new0(struct plugin_info, 1);
+ info->abiver = BITLBEE_ABI_VERSION_CODE;
+ info->name = ret->name;
+ info->version = prot->info->version;
+ info->description = prot->info->description;
+ info->author = prot->info->author;
+ info->url = prot->info->homepage;
+
+ plugin_info_add(info);
}
g_string_append(help, "\n\nFor used protocols, more information about available "
diff --git a/root_commands.c b/root_commands.c
index 6bc34fb5..0ea380af 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -1221,8 +1221,17 @@ static void cmd_plugins(irc_t *irc, char **cmd)
irc_rootmsg(irc, format, "Plugin", "Version");
for (l = get_plugins(); l; l = l->next) {
+ char *c;
info = l->data;
- irc_rootmsg(irc, format, info->name, info->version);
+
+ /* some purple plugins like to include several versions separated by newlines... */
+ if ((c = strchr(info->version, '\n'))) {
+ char *version = g_strndup(info->version, c - info->version);
+ irc_rootmsg(irc, format, info->name, version);
+ g_free(version);
+ } else {
+ irc_rootmsg(irc, format, info->name, info->version);
+ }
}
#endif