diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-05-20 10:36:02 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-05-20 10:54:58 +0200 |
commit | fc5fa629513d804dee5371f85acc4c4558e699a1 (patch) | |
tree | 02d725b4e5274fff122deae4ca67c1e5ad700dc0 /src/xmpp | |
parent | aef74f90ece0d71a981312372e9a10df64e7035c (diff) | |
download | profani-tty-fc5fa629513d804dee5371f85acc4c4558e699a1.tar.gz |
Create call_external() helper function
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/avatar.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/xmpp/avatar.c b/src/xmpp/avatar.c index 9d043cb3..701d6cb7 100644 --- a/src/xmpp/avatar.c +++ b/src/xmpp/avatar.c @@ -266,15 +266,7 @@ _avatar_request_item_result_handler(xmpp_stanza_t *const stanza, void *const use // if we shall open it if (g_hash_table_contains(shall_open, from_attr)) { - GString *cmd = g_string_new(""); - - g_string_append_printf(cmd, "%s %s > /dev/null 2>&1", prefs_get_string(PREF_AVATAR_CMD), filename->str); - cons_show("Calling: %s", cmd->str); - FILE *stream = popen(cmd->str, "r"); - - pclose(stream); - g_string_free(cmd, TRUE); - + call_external(prefs_get_string(PREF_AVATAR_CMD), filename->str); g_hash_table_remove(shall_open, from_attr); } |