diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rwxr-xr-x | install-all.sh | 12 | ||||
-rw-r--r-- | src/command/commands.c | 11 | ||||
-rw-r--r-- | src/ui/inputwin.c | 2 | ||||
-rw-r--r-- | src/xmpp/connection.c | 14 | ||||
-rw-r--r-- | src/xmpp/xmpp.h | 2 | ||||
-rw-r--r-- | tests/functionaltests/proftest.c | 2 | ||||
-rw-r--r-- | tests/functionaltests/test_connect.c | 2 | ||||
-rw-r--r-- | tests/unittests/xmpp/stub_xmpp.c | 7 |
10 files changed, 37 insertions, 20 deletions
diff --git a/.travis.yml b/.travis.yml index ade6084b..bf9ac29a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ install: - lsb_release -a - uname -a - sudo apt-get update - - sudo apt-get -y install libssl-dev libexpat1-dev libncursesw5-dev libglib2.0-dev libnotify-dev libcurl3-dev libxss-dev libotr2-dev libgpgme11-dev uuid-dev expect-dev tcl-dev + - sudo apt-get -y install libssl-dev libexpat1-dev libncursesw5-dev libglib2.0-dev libnotify-dev libcurl3-dev libxss-dev libotr2-dev libgpgme11-dev expect-dev tcl-dev - git clone git://github.com/boothj5/libmesode.git - cd libmesode - mkdir m4 diff --git a/configure.ac b/configure.ac index bc0afaae..28ed7efe 100644 --- a/configure.ac +++ b/configure.ac @@ -106,9 +106,6 @@ AS_IF([test "x$PLATFORM" != xosx], AC_SUBST(AM_LDFLAGS)], [AC_MSG_ERROR([libreadline is required for profanity])])]) -AC_CHECK_LIB([uuid], [uuid_generate], [], - [AC_MSG_ERROR([libuuid is required for profanity])]) - AS_IF([test "x$PLATFORM" = xosx], [LIBS="-lcurl $LIBS"]) ### Check for desktop notification support diff --git a/install-all.sh b/install-all.sh index f79c3e88..641423f6 100755 --- a/install-all.sh +++ b/install-all.sh @@ -24,7 +24,7 @@ debian_prepare() echo echo Profanity installer... installing dependencies echo - sudo apt-get -y install git automake autoconf libssl-dev libexpat1-dev libncursesw5-dev libglib2.0-dev libnotify-dev libcurl3-dev libxss-dev libotr5-dev libreadline-dev libtool libgpgme11-dev uuid-dev + sudo apt-get -y install git automake autoconf libssl-dev libexpat1-dev libncursesw5-dev libglib2.0-dev libnotify-dev libcurl3-dev libxss-dev libotr5-dev libreadline-dev libtool libgpgme11-dev } @@ -34,7 +34,7 @@ fedora_prepare() echo Profanity installer... installing dependencies echo - sudo dnf -y install gcc git autoconf automake openssl-devel expat-devel ncurses-devel glib2-devel libnotify-devel libcurl-devel libXScrnSaver-devel libotr3-devel readline-devel libtool libuuid-devel gpgme-devel + sudo dnf -y install gcc git autoconf automake openssl-devel expat-devel ncurses-devel glib2-devel libnotify-devel libcurl-devel libXScrnSaver-devel libotr3-devel readline-devel libtool gpgme-devel } opensuse_prepare() @@ -42,7 +42,7 @@ opensuse_prepare() echo echo Profanity installer...installing dependencies echo - sudo zypper -n in gcc git automake make autoconf libopenssl-devel expat libexpat-devel ncurses-devel glib2-devel libnotify-devel libcurl-devel libXScrnSaver-devel libotr-devel readline-devel libtool libuuid-devel libgpgme-devel + sudo zypper -n in gcc git automake make autoconf libopenssl-devel expat libexpat-devel ncurses-devel glib2-devel libnotify-devel libcurl-devel libXScrnSaver-devel libotr-devel readline-devel libtool libgpgme-devel } centos_prepare() @@ -54,7 +54,7 @@ centos_prepare() sudo yum -y install epel-release sudo yum -y install git sudo yum -y install gcc autoconf automake cmake - sudo yum -y install openssl-devel expat-devel ncurses-devel glib2-devel libnotify-devel libcurl-devel libXScrnSaver-devel libotr-devel readline-devel libtool libuuid-devel gpgme-devel + sudo yum -y install openssl-devel expat-devel ncurses-devel glib2-devel libnotify-devel libcurl-devel libXScrnSaver-devel libotr-devel readline-devel libtool gpgme-devel } cygwin_prepare() @@ -65,9 +65,9 @@ cygwin_prepare() if ! command -v apt-cyg &>/dev/null; then cyg_install_apt_cyg; fi if [ -n "$CYG_MIRROR" ]; then - apt-cyg -m $CYG_MIRROR install git make gcc-core m4 automake autoconf pkg-config openssl-devel libexpat-devel zlib-devel libncursesw-devel libglib2.0-devel libcurl-devel libidn-devel libssh2-devel libkrb5-devel openldap-devel libgcrypt-devel libreadline-devel libgpgme-devel libtool libuuid-devel + apt-cyg -m $CYG_MIRROR install git make gcc-core m4 automake autoconf pkg-config openssl-devel libexpat-devel zlib-devel libncursesw-devel libglib2.0-devel libcurl-devel libidn-devel libssh2-devel libkrb5-devel openldap-devel libgcrypt-devel libreadline-devel libgpgme-devel libtool else - apt-cyg install git make gcc-core m4 automake autoconf pkg-config openssl-devel libexpat-devel zlib-devel libncursesw-devel libglib2.0-devel libcurl-devel libidn-devel libssh2-devel libkrb5-devel openldap-devel libgcrypt-devel libreadline-devel libgpgme-devel libtool libuuid-devel + apt-cyg install git make gcc-core m4 automake autoconf pkg-config openssl-devel libexpat-devel zlib-devel libncursesw-devel libglib2.0-devel libcurl-devel libidn-devel libssh2-devel libkrb5-devel openldap-devel libgcrypt-devel libreadline-devel libgpgme-devel libtool fi } diff --git a/src/command/commands.c b/src/command/commands.c index eb4aa03f..7df1477a 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -38,7 +38,6 @@ #include <stdlib.h> #include <errno.h> #include <assert.h> -#include <uuid/uuid.h> #include <glib.h> #include "chat_session.h" @@ -2267,22 +2266,18 @@ cmd_join(ProfWin *window, const char * const command, gchar **args) } if (args[0] == NULL) { - uuid_t uuid; - uuid_generate(uuid); - char *uuid_str = malloc(sizeof(char) * 37); - uuid_unparse_lower(uuid, uuid_str); - char *account_name = jabber_get_account_name(); ProfAccount *account = accounts_get_account(account_name); GString *room_str = g_string_new(""); - g_string_append_printf(room_str, "private-chat-%s@%s", uuid_str, account->muc_service); + char *uuid = jabber_create_uuid(); + g_string_append_printf(room_str, "private-chat-%s@%s", uuid, account->muc_service); + jabber_free_uuid(uuid); presence_join_room(room_str->str, account->muc_nick, NULL); muc_join(room_str->str, account->muc_nick, NULL, FALSE); g_string_free(room_str, TRUE); - free(uuid_str); account_free(account); return TRUE; diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index af738cc6..43e2a3a7 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -235,6 +235,7 @@ inp_get_line(void) char *line = NULL; while (!line) { line = inp_readline(); + ui_update(); } status_bar_clear(); return line; @@ -251,6 +252,7 @@ inp_get_password(void) get_password = TRUE; while (!password) { password = inp_readline(); + ui_update(); } get_password = FALSE; status_bar_clear(); diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index abc08732..5ad5e108 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -310,6 +310,20 @@ jabber_get_account_name(void) return saved_account.name; } +char* +jabber_create_uuid(void) +{ + return xmpp_uuid_gen(jabber_conn.ctx); +} + +void +jabber_free_uuid(char *uuid) +{ + if (uuid) { + xmpp_free(jabber_conn.ctx, uuid); + } +} + void connection_set_presence_message(const char * const message) { diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index 2a8cbb59..839df9a7 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -150,6 +150,8 @@ jabber_conn_status_t jabber_get_connection_status(void); char * jabber_get_presence_message(void); char* jabber_get_account_name(void); GList * jabber_get_available_resources(void); +char* jabber_create_uuid(void); +void jabber_free_uuid(char *uuid); // message functions char* message_send_chat(const char * const barejid, const char * const msg); diff --git a/tests/functionaltests/proftest.c b/tests/functionaltests/proftest.c index b839ee48..54837c9f 100644 --- a/tests/functionaltests/proftest.c +++ b/tests/functionaltests/proftest.c @@ -244,7 +244,7 @@ prof_connect_with_roster(char *roster) "</presence>" ); - prof_input("/connect stabber@localhost port 5230"); + prof_input("/connect stabber@localhost server 127.0.0.1 port 5230"); prof_input("password"); // Allow time for profanity to connect diff --git a/tests/functionaltests/test_connect.c b/tests/functionaltests/test_connect.c index 5fcb8a2f..9abd1eff 100644 --- a/tests/functionaltests/test_connect.c +++ b/tests/functionaltests/test_connect.c @@ -50,7 +50,7 @@ connect_jid_requests_bookmarks(void **state) void connect_bad_password(void **state) { - prof_input("/connect stabber@localhost port 5230"); + prof_input("/connect stabber@localhost server 127.0.0.1 port 5230"); prof_input("badpassword"); assert_true(prof_output_exact("Login failed.")); diff --git a/tests/unittests/xmpp/stub_xmpp.c b/tests/unittests/xmpp/stub_xmpp.c index 34c52a63..14a0b01d 100644 --- a/tests/unittests/xmpp/stub_xmpp.c +++ b/tests/unittests/xmpp/stub_xmpp.c @@ -37,6 +37,13 @@ const char * jabber_get_domain(void) return NULL; } +char* jabber_create_uuid(void) +{ + return NULL; +} + +void jabber_free_uuid(char * uuid) {} + jabber_conn_status_t jabber_get_connection_status(void) { return (jabber_conn_status_t)mock(); |