1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Merge branch 'master' into plugins

This commit is contained in:
James Booth 2016-09-05 23:31:14 +01:00
commit 6a8f78303f
6 changed files with 18 additions and 6 deletions

View File

@ -191,7 +191,7 @@ else
fi
# threading
ACX_PTHREAD
ACX_PTHREAD([], [AC_MSG_ERROR([pthread is required])])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AS_IF([test "x$PTHREAD_CC" != x], [ CC="$PTHREAD_CC" ])

View File

@ -3002,18 +3002,22 @@ _complete_filepath(const char *const input, char *const startstr)
char * acstring;
if (output_off) {
if (asprintf(&tmp, "%s/%s", directory, dir->d_name) == -1) {
free(foofile);
return NULL;
}
if (asprintf(&acstring, "~/%s", tmp+output_off) == -1) {
free(foofile);
return NULL;
}
free(tmp);
} else if (strcmp(directory, "/") == 0) {
if (asprintf(&acstring, "/%s", dir->d_name) == -1) {
free(foofile);
return NULL;
}
} else {
if (asprintf(&acstring, "%s/%s", directory, dir->d_name) == -1) {
free(foofile);
return NULL;
}
}
@ -3023,9 +3027,9 @@ _complete_filepath(const char *const input, char *const startstr)
closedir(d);
}
} else {
free(foofile);
free(directory);
}
free(foofile);
result = autocomplete_param_with_ac(input, startstr, filepath_ac, TRUE);
if (result) {

View File

@ -1992,10 +1992,10 @@ static struct cmd_t command_defs[] =
{ "reload [<plugin>]", "Reload a plugin, passing no argument will reload all plugins." },
{ "python_version", "Show the Python interpreter version." })
CMD_EXAMPLES(
"/plugin install /home/steveharris/Downloads/metal.py",
"/plugin load browser.py",
"/plugin unload say.py",
"/plugin reload wikipedia.py")
"/plugins install /home/steveharris/Downloads/metal.py",
"/plugins load browser.py",
"/plugins unload say.py",
"/plugins reload wikipedia.py")
},
{ "/prefs",

View File

@ -6090,6 +6090,7 @@ cmd_plugins(ProfWin *window, const char *const command, gchar **args)
}
g_free(plugin_name);
free(filename);
return TRUE;
} else if (g_strcmp0(args[0], "load") == 0) {
if (args[1] == NULL) {

View File

@ -297,6 +297,7 @@ connection_jid_for_feature(const char *const feature)
char *jid = curr->data;
GHashTable *features = g_hash_table_lookup(conn.features_by_jid, jid);
if (features && g_hash_table_lookup(features, feature)) {
g_list_free(jids);
return jid;
}

View File

@ -244,6 +244,8 @@ stanza_create_http_upload_request(xmpp_ctx_t *ctx, const char *const id,
free(filename_cpy);
xmpp_stanza_add_child(filename, filename_txt);
xmpp_stanza_add_child(request, filename);
xmpp_stanza_release(filename_txt);
xmpp_stanza_release(filename);
xmpp_stanza_t *size = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(size, STANZA_NAME_SIZE);
@ -255,6 +257,8 @@ stanza_create_http_upload_request(xmpp_ctx_t *ctx, const char *const id,
}
xmpp_stanza_add_child(size, size_txt);
xmpp_stanza_add_child(request, size);
xmpp_stanza_release(size_txt);
xmpp_stanza_release(size);
xmpp_stanza_t *content_type = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(content_type, STANZA_NAME_CONTENT_TYPE);
@ -262,6 +266,8 @@ stanza_create_http_upload_request(xmpp_ctx_t *ctx, const char *const id,
xmpp_stanza_set_text(content_type_txt, upload->mime_type);
xmpp_stanza_add_child(content_type, content_type_txt);
xmpp_stanza_add_child(request, content_type);
xmpp_stanza_release(content_type_txt);
xmpp_stanza_release(content_type);
xmpp_stanza_add_child(iq, request);
xmpp_stanza_release(request);