void prof_connect_with_roster(char *roster) { GString *roster_str = g_string_new( "<iq type='result' to='stabber@localhost/profanity'>" "<query xmlns='jabber:iq:roster' ver='362'>" ); g_string_append(roster_str, roster); g_string_append(roster_str, "</query>" "</iq>" ); stbbr_for_query("jabber:iq:roster", roster_str->str); g_string_free(roster_str, TRUE); stbbr_for_id("prof_presence_1", "<presence id='prof_presence_1' lang='en' to='stabber@localhost/profanity' from='stabber@localhost/profanity'>" "<priority>0</priority>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='f8mrtdyAmhnj8Ca+630bThSL718='/>" "</presence>" ); prof_input("/connect stabber@localhost server 127.0.0.1 port 5230 tls allow"); prof_input("password"); // Allow time for profanity to connect exp_timeout = 30; assert_true(prof_output_regex("stabber@localhost logged in successfully, .+online.+ \\(priority 0\\)\\.")); exp_timeout = 10; stbbr_wait_for("prof_presence_*"); }
void prof_connect_with_roster(char *roster) { GString *roster_str = g_string_new( "<iq type=\"result\" to=\"stabber@localhost/profanity\">" "<query xmlns=\"jabber:iq:roster\" ver=\"362\">" ); g_string_append(roster_str, roster); g_string_append(roster_str, "</query>" "</iq>" ); stbbr_for_query("jabber:iq:roster", roster_str->str); g_string_free(roster_str, TRUE); stbbr_for_id("prof_presence_1", "<presence id=\"prof_presence_1\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"stabber@localhost/profanity\">" "<priority>0</priority>" "<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" node=\"http://www.profanity.im\" ver=\"f8mrtdyAmhnj8Ca+630bThSL718=\"/>" "</presence>" ); prof_input("/connect stabber@localhost port 5230"); prof_input("password"); // Allow time for profanity to connect exp_timeout = 30; assert_true(prof_output_regex("stabber@localhost logged in successfully, .+online.+ \\(priority 0\\)\\.")); exp_timeout = 10; stbbr_wait_for("prof_presence_*"); }