mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Merge branch 'master' into osx-functional
This commit is contained in:
commit
43b1329b48
src
command
config
event
ui
tests
@ -113,6 +113,7 @@ static char* _wins_autocomplete(ProfWin *window, const char *const input);
|
||||
static char* _tls_autocomplete(ProfWin *window, const char *const input);
|
||||
static char* _script_autocomplete(ProfWin *window, const char *const input);
|
||||
static char* _subject_autocomplete(ProfWin *window, const char *const input);
|
||||
static char* _console_autocomplete(ProfWin *window, const char *const input);
|
||||
|
||||
GHashTable *commands = NULL;
|
||||
|
||||
@ -972,6 +973,23 @@ static struct cmd_t command_defs[] =
|
||||
CMD_NOEXAMPLES
|
||||
},
|
||||
|
||||
{ "/console",
|
||||
cmd_console, parse_args, 2, 2, &cons_console_setting,
|
||||
CMD_TAGS(
|
||||
CMD_TAG_UI,
|
||||
CMD_TAG_GROUPCHAT)
|
||||
CMD_SYN(
|
||||
"/console muc all|first|none")
|
||||
CMD_DESC(
|
||||
"Configure what is displayed in the console window when new chat room messages are received. "
|
||||
"The default is set to 'all'.")
|
||||
CMD_ARGS(
|
||||
{ "muc all", "Indicate all new chat room messages in the console." },
|
||||
{ "muc first", "Indicate only the first new message in each room in the console." },
|
||||
{ "muc none", "Do not show any new messages in the console window." })
|
||||
CMD_NOEXAMPLES
|
||||
},
|
||||
|
||||
{ "/encwarn",
|
||||
cmd_encwarn, parse_args, 1, 1, &cons_encwarn_setting,
|
||||
CMD_TAGS(
|
||||
@ -1888,6 +1906,8 @@ static Autocomplete tls_ac;
|
||||
static Autocomplete tls_certpath_ac;
|
||||
static Autocomplete script_ac;
|
||||
static Autocomplete script_show_ac;
|
||||
static Autocomplete console_ac;
|
||||
static Autocomplete console_muc_ac;
|
||||
|
||||
/*
|
||||
* Initialise command autocompleter and history
|
||||
@ -2373,6 +2393,14 @@ cmd_init(void)
|
||||
autocomplete_add(script_ac, "show");
|
||||
|
||||
script_show_ac = NULL;
|
||||
|
||||
console_ac = autocomplete_new();
|
||||
autocomplete_add(console_ac, "muc");
|
||||
|
||||
console_muc_ac = autocomplete_new();
|
||||
autocomplete_add(console_muc_ac, "all");
|
||||
autocomplete_add(console_muc_ac, "first");
|
||||
autocomplete_add(console_muc_ac, "none");
|
||||
}
|
||||
|
||||
void
|
||||
@ -2450,6 +2478,8 @@ cmd_uninit(void)
|
||||
autocomplete_free(tls_certpath_ac);
|
||||
autocomplete_free(script_ac);
|
||||
autocomplete_free(script_show_ac);
|
||||
autocomplete_free(console_ac);
|
||||
autocomplete_free(console_muc_ac);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -2642,6 +2672,8 @@ cmd_reset_autocomplete(ProfWin *window)
|
||||
autocomplete_reset(pgp_log_ac);
|
||||
autocomplete_reset(tls_ac);
|
||||
autocomplete_reset(tls_certpath_ac);
|
||||
autocomplete_reset(console_ac);
|
||||
autocomplete_reset(console_muc_ac);
|
||||
autocomplete_reset(script_ac);
|
||||
if (script_show_ac) {
|
||||
autocomplete_free(script_show_ac);
|
||||
@ -2903,7 +2935,8 @@ _cmd_complete_parameters(ProfWin *window, const char *const input)
|
||||
g_hash_table_insert(ac_funcs, "/wins", _wins_autocomplete);
|
||||
g_hash_table_insert(ac_funcs, "/tls", _tls_autocomplete);
|
||||
g_hash_table_insert(ac_funcs, "/script", _script_autocomplete);
|
||||
g_hash_table_insert(ac_funcs, "/subject", _subject_autocomplete);
|
||||
g_hash_table_insert(ac_funcs, "/subject", _subject_autocomplete);
|
||||
g_hash_table_insert(ac_funcs, "/console", _console_autocomplete);
|
||||
|
||||
int len = strlen(input);
|
||||
char parsed[len+1];
|
||||
@ -4135,6 +4168,24 @@ _join_autocomplete(ProfWin *window, const char *const input)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char*
|
||||
_console_autocomplete(ProfWin *window, const char *const input)
|
||||
{
|
||||
char *result = NULL;
|
||||
|
||||
result = autocomplete_param_with_ac(input, "/console muc", console_muc_ac, TRUE);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = autocomplete_param_with_ac(input, "/console", console_ac, TRUE);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char*
|
||||
_subject_autocomplete(ProfWin *window, const char *const input)
|
||||
{
|
||||
|
@ -4034,6 +4034,26 @@ cmd_beep(ProfWin *window, const char *const command, gchar **args)
|
||||
return _cmd_set_boolean_preference(args[0], command, "Sound", PREF_BEEP);
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_console(ProfWin *window, const char *const command, gchar **args)
|
||||
{
|
||||
if (g_strcmp0(args[0], "muc") != 0) {
|
||||
cons_bad_cmd_usage(command);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char *setting = args[1];
|
||||
if ((g_strcmp0(setting, "all") != 0) && (g_strcmp0(setting, "first") != 0) && (g_strcmp0(setting, "none") != 0)) {
|
||||
cons_bad_cmd_usage(command);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
prefs_set_string(PREF_CONSOLE_MUC, setting);
|
||||
cons_show("Console MUC messages set: %s", setting);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_presence(ProfWin *window, const char *const command, gchar **args)
|
||||
{
|
||||
|
@ -152,6 +152,7 @@ gboolean cmd_encwarn(ProfWin *window, const char *const command, gchar **args);
|
||||
gboolean cmd_script(ProfWin *window, const char *const command, gchar **args);
|
||||
gboolean cmd_export(ProfWin *window, const char *const command, gchar **args);
|
||||
gboolean cmd_charset(ProfWin *window, const char *const command, gchar **args);
|
||||
gboolean cmd_console(ProfWin *window, const char *const command, gchar **args);
|
||||
|
||||
gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args);
|
||||
|
||||
|
@ -1034,6 +1034,7 @@ _get_group(preference_t pref)
|
||||
case PREF_ENC_WARN:
|
||||
case PREF_INPBLOCK_DYNAMIC:
|
||||
case PREF_TLS_SHOW:
|
||||
case PREF_CONSOLE_MUC:
|
||||
return PREF_GROUP_UI;
|
||||
case PREF_STATES:
|
||||
case PREF_OUTTYPE:
|
||||
@ -1238,6 +1239,8 @@ _get_key(preference_t pref)
|
||||
return "tls.show";
|
||||
case PREF_LASTACTIVITY:
|
||||
return "lastactivity";
|
||||
case PREF_CONSOLE_MUC:
|
||||
return "console.muc";
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@ -1324,6 +1327,8 @@ _get_default_string(preference_t pref)
|
||||
return "%d/%m/%y %H:%M:%S";
|
||||
case PREF_PGP_LOG:
|
||||
return "redact";
|
||||
case PREF_CONSOLE_MUC:
|
||||
return "all";
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
@ -123,6 +123,7 @@ typedef enum {
|
||||
PREF_TLS_CERTPATH,
|
||||
PREF_TLS_SHOW,
|
||||
PREF_LASTACTIVITY,
|
||||
PREF_CONSOLE_MUC,
|
||||
} preference_t;
|
||||
|
||||
typedef struct prof_alias_t {
|
||||
|
@ -240,7 +240,13 @@ sv_ev_room_message(const char *const room_jid, const char *const nick,
|
||||
// not currently on groupchat window
|
||||
} else {
|
||||
status_bar_new(num);
|
||||
cons_show_incoming_room_message(nick, mucwin->roomjid, num);
|
||||
char *muc_show = prefs_get_string(PREF_CONSOLE_MUC);
|
||||
if (g_strcmp0(muc_show, "all") == 0) {
|
||||
cons_show_incoming_room_message(nick, mucwin->roomjid, num);
|
||||
} else if (g_strcmp0(muc_show, "first") == 0 && mucwin->unread == 0) {
|
||||
cons_show_incoming_room_message(NULL, mucwin->roomjid, num);
|
||||
}
|
||||
prefs_free_string(muc_show);
|
||||
|
||||
if (prefs_get_boolean(PREF_FLASH) && (strcmp(nick, my_nick) != 0)) {
|
||||
flash();
|
||||
|
@ -311,7 +311,11 @@ cons_show_incoming_room_message(const char *const nick, const char *const room,
|
||||
ui_index = 0;
|
||||
}
|
||||
|
||||
win_vprint(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< room message: %s in %s (win %d)", nick, room, ui_index);
|
||||
if (nick) {
|
||||
win_vprint(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< room message: %s in %s (win %d)", nick, room, ui_index);
|
||||
} else {
|
||||
win_vprint(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< room message: %s (win %d)", room, ui_index);
|
||||
}
|
||||
|
||||
cons_alert();
|
||||
}
|
||||
@ -1075,6 +1079,14 @@ cons_encwarn_setting(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cons_console_setting(void)
|
||||
{
|
||||
char *setting = prefs_get_string(PREF_CONSOLE_MUC);
|
||||
cons_show("Console MUC messages (/console) : %s", setting);
|
||||
prefs_free_string(setting);
|
||||
}
|
||||
|
||||
void
|
||||
cons_tlsshow_setting(void)
|
||||
{
|
||||
@ -1345,6 +1357,7 @@ cons_show_ui_prefs(void)
|
||||
cons_resource_setting();
|
||||
cons_vercheck_setting();
|
||||
cons_statuses_setting();
|
||||
cons_console_setting();
|
||||
cons_occupants_setting();
|
||||
cons_roster_setting();
|
||||
cons_privileges_setting();
|
||||
|
@ -268,6 +268,7 @@ void cons_theme_setting(void);
|
||||
void cons_resource_setting(void);
|
||||
void cons_privileges_setting(void);
|
||||
void cons_beep_setting(void);
|
||||
void cons_console_setting(void);
|
||||
void cons_flash_setting(void);
|
||||
void cons_splash_setting(void);
|
||||
void cons_encwarn_setting(void);
|
||||
|
@ -101,7 +101,9 @@ int main(int argc, char* argv[]) {
|
||||
PROF_FUNC_TEST(shows_history_message),
|
||||
PROF_FUNC_TEST(shows_occupant_join),
|
||||
PROF_FUNC_TEST(shows_message),
|
||||
PROF_FUNC_TEST(shows_message_in_console_when_window_not_focussed),
|
||||
PROF_FUNC_TEST(shows_all_messages_in_console_when_window_not_focussed),
|
||||
PROF_FUNC_TEST(shows_first_message_in_console_when_window_not_focussed),
|
||||
PROF_FUNC_TEST(shows_no_message_in_console_when_window_not_focussed),
|
||||
};
|
||||
|
||||
return run_tests(all_tests);
|
||||
|
@ -259,8 +259,8 @@ 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\">"
|
||||
"<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,
|
||||
@ -272,9 +272,9 @@ prof_connect_with_roster(char *roster)
|
||||
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\">"
|
||||
"<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=\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='f8mrtdyAmhnj8Ca+630bThSL718='/>"
|
||||
"</presence>"
|
||||
);
|
||||
|
||||
@ -288,11 +288,23 @@ prof_connect_with_roster(char *roster)
|
||||
stbbr_wait_for("prof_presence_*");
|
||||
}
|
||||
|
||||
void
|
||||
prof_timeout(int timeout)
|
||||
{
|
||||
exp_timeout = timeout;
|
||||
}
|
||||
|
||||
void
|
||||
prof_timeout_reset(void)
|
||||
{
|
||||
exp_timeout = 10;
|
||||
}
|
||||
|
||||
void
|
||||
prof_connect(void)
|
||||
{
|
||||
prof_connect_with_roster(
|
||||
"<item jid=\"buddy1@localhost\" subscription=\"both\" name=\"Buddy1\"/>"
|
||||
"<item jid=\"buddy2@localhost\" subscription=\"both\" name=\"Buddy2\"/>"
|
||||
"<item jid='buddy1@localhost' subscription='both' name='Buddy1'/>"
|
||||
"<item jid='buddy2@localhost' subscription='both' name='Buddy2'/>"
|
||||
);
|
||||
}
|
||||
|
@ -16,4 +16,7 @@ int prof_output_exact(char *text);
|
||||
int prof_output_regex(char *text);
|
||||
int prof_output_glob(char *text);
|
||||
|
||||
void prof_timeout(int timeout);
|
||||
void prof_timeout_reset(void);
|
||||
|
||||
#endif
|
||||
|
@ -19,7 +19,7 @@ send_enable_carbons(void **state)
|
||||
prof_input("/carbons on");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"*\" type=\"set\"><enable xmlns=\"urn:xmpp:carbons:2\"/></iq>"
|
||||
"<iq id='*' type='set'><enable xmlns='urn:xmpp:carbons:2'/></iq>"
|
||||
));
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ connect_with_carbons_enabled(void **state)
|
||||
prof_connect();
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"*\" type=\"set\"><enable xmlns=\"urn:xmpp:carbons:2\"/></iq>"
|
||||
"<iq id='*' type='set'><enable xmlns='urn:xmpp:carbons:2'/></iq>"
|
||||
));
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ send_disable_carbons(void **state)
|
||||
prof_input("/carbons off");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"*\" type=\"set\"><disable xmlns=\"urn:xmpp:carbons:2\"/></iq>"
|
||||
"<iq id='*' type='set'><disable xmlns='urn:xmpp:carbons:2'/></iq>"
|
||||
));
|
||||
}
|
||||
|
||||
@ -56,24 +56,24 @@ receive_carbon(void **state)
|
||||
|
||||
prof_connect();
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"*\" type=\"set\"><enable xmlns=\"urn:xmpp:carbons:2\"/></iq>"
|
||||
"<iq id='*' type='set'><enable xmlns='urn:xmpp:carbons:2'/></iq>"
|
||||
));
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"<status>On my mobile</status>"
|
||||
"</presence>"
|
||||
);
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online, \"On my mobile\""));
|
||||
prof_input("/msg Buddy1");
|
||||
prof_output_exact("unencrypted");
|
||||
assert_true(prof_output_exact("unencrypted"));
|
||||
|
||||
stbbr_send(
|
||||
"<message type=\"chat\" to=\"stabber@localhost/profanity\" from=\"buddy1@localhost\">"
|
||||
"<received xmlns=\"urn:xmpp:carbons:2\">"
|
||||
"<forwarded xmlns=\"urn:xmpp:forward:0\">"
|
||||
"<message id=\"prof_msg_7\" xmlns=\"jabber:client\" type=\"chat\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"buddy1@localhost/mobile\">"
|
||||
"<message type='chat' to='stabber@localhost/profanity' from='buddy1@localhost'>"
|
||||
"<received xmlns='urn:xmpp:carbons:2'>"
|
||||
"<forwarded xmlns='urn:xmpp:forward:0'>"
|
||||
"<message id='prof_msg_7' xmlns='jabber:client' type='chat' lang='en' to='stabber@localhost/profanity' from='buddy1@localhost/mobile'>"
|
||||
"<body>test carbon from recipient</body>"
|
||||
"</message>"
|
||||
"</forwarded>"
|
||||
@ -91,24 +91,24 @@ receive_self_carbon(void **state)
|
||||
|
||||
prof_connect();
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"*\" type=\"set\"><enable xmlns=\"urn:xmpp:carbons:2\"/></iq>"
|
||||
"<iq id='*' type='set'><enable xmlns='urn:xmpp:carbons:2'/></iq>"
|
||||
));
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"<status>On my mobile</status>"
|
||||
"</presence>"
|
||||
);
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online, \"On my mobile\""));
|
||||
prof_input("/msg Buddy1");
|
||||
prof_output_exact("unencrypted");
|
||||
assert_true(prof_output_exact("unencrypted"));
|
||||
|
||||
stbbr_send(
|
||||
"<message type=\"chat\" to=\"stabber@localhost/profanity\" from=\"stabber@localhost\">"
|
||||
"<sent xmlns=\"urn:xmpp:carbons:2\">"
|
||||
"<forwarded xmlns=\"urn:xmpp:forward:0\">"
|
||||
"<message id=\"59\" xmlns=\"jabber:client\" type=\"chat\" to=\"buddy1@localhost/mobile\" lang=\"en\" from=\"stabber@localhost/profanity\">"
|
||||
"<message type='chat' to='stabber@localhost/profanity' from='stabber@localhost'>"
|
||||
"<sent xmlns='urn:xmpp:carbons:2'>"
|
||||
"<forwarded xmlns='urn:xmpp:forward:0'>"
|
||||
"<message id='59' xmlns='jabber:client' type='chat' to='buddy1@localhost/mobile' lang='en' from='stabber@localhost/profanity'>"
|
||||
"<body>self sent carbon</body>"
|
||||
"</message>"
|
||||
"</forwarded>"
|
||||
|
@ -19,7 +19,7 @@ sends_message_to_barejid_when_contact_offline(void **state)
|
||||
prof_input("/msg buddy1@localhost Hi there");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost' type='chat'>"
|
||||
"<body>Hi there</body>"
|
||||
"</message>"
|
||||
));
|
||||
@ -31,7 +31,7 @@ sends_message_to_barejid_when_contact_online(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost/profanity\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost/profanity' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"</presence>"
|
||||
);
|
||||
@ -40,7 +40,7 @@ sends_message_to_barejid_when_contact_online(void **state)
|
||||
prof_input("/msg buddy1@localhost Hi there");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost' type='chat'>"
|
||||
"<body>Hi there</body>"
|
||||
"</message>"
|
||||
));
|
||||
@ -52,14 +52,14 @@ sends_message_to_fulljid_when_received_from_fulljid(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"</presence>"
|
||||
);
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online"));
|
||||
|
||||
stbbr_send(
|
||||
"<message id=\"message1\" to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='message1' to='stabber@localhost' from='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>First message</body>"
|
||||
"</message>"
|
||||
);
|
||||
@ -68,7 +68,7 @@ sends_message_to_fulljid_when_received_from_fulljid(void **state)
|
||||
prof_input("/msg buddy1@localhost Hi there");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>Hi there</body>"
|
||||
"</message>"
|
||||
));
|
||||
@ -80,14 +80,14 @@ sends_subsequent_messages_to_fulljid(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"</presence>"
|
||||
);
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online"));
|
||||
|
||||
stbbr_send(
|
||||
"<message id=\"message1\" to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='message1' to='stabber@localhost' from='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>First message</body>"
|
||||
"</message>"
|
||||
);
|
||||
@ -95,21 +95,21 @@ sends_subsequent_messages_to_fulljid(void **state)
|
||||
|
||||
prof_input("/msg buddy1@localhost Outgoing 1");
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>Outgoing 1</body>"
|
||||
"</message>"
|
||||
));
|
||||
|
||||
prof_input("/msg buddy1@localhost Outgoing 2");
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>Outgoing 2</body>"
|
||||
"</message>"
|
||||
));
|
||||
|
||||
prof_input("/msg buddy1@localhost Outgoing 3");
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>Outgoing 3</body>"
|
||||
"</message>"
|
||||
));
|
||||
@ -121,14 +121,14 @@ resets_to_barejid_after_presence_received(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"</presence>"
|
||||
);
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online"));
|
||||
|
||||
stbbr_send(
|
||||
"<message id=\"message1\" to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='message1' to='stabber@localhost' from='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>First message</body>"
|
||||
"</message>"
|
||||
);
|
||||
@ -136,13 +136,13 @@ resets_to_barejid_after_presence_received(void **state)
|
||||
|
||||
prof_input("/msg buddy1@localhost Outgoing 1");
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>Outgoing 1</body>"
|
||||
"</message>"
|
||||
));
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/laptop'>"
|
||||
"<priority>5</priority>"
|
||||
"<show>dnd</show>"
|
||||
"</presence>"
|
||||
@ -151,7 +151,7 @@ resets_to_barejid_after_presence_received(void **state)
|
||||
|
||||
prof_input("/msg buddy1@localhost Outgoing 2");
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost' type='chat'>"
|
||||
"<body>Outgoing 2</body>"
|
||||
"</message>"
|
||||
));
|
||||
@ -163,14 +163,14 @@ new_session_when_message_received_from_different_fulljid(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"</presence>"
|
||||
);
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online"));
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/laptop'>"
|
||||
"<priority>8</priority>"
|
||||
"<show>away</show>"
|
||||
"</presence>"
|
||||
@ -178,7 +178,7 @@ new_session_when_message_received_from_different_fulljid(void **state)
|
||||
assert_true(prof_output_exact("Buddy1 (laptop) is away"));
|
||||
|
||||
stbbr_send(
|
||||
"<message id=\"message1\" to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='message1' to='stabber@localhost' from='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>From first resource</body>"
|
||||
"</message>"
|
||||
);
|
||||
@ -186,13 +186,13 @@ new_session_when_message_received_from_different_fulljid(void **state)
|
||||
|
||||
prof_input("/msg buddy1@localhost Outgoing 1");
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>Outgoing 1</body>"
|
||||
"</message>"
|
||||
));
|
||||
|
||||
stbbr_send(
|
||||
"<message id=\"message1\" to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\" type=\"chat\">"
|
||||
"<message id='message1' to='stabber@localhost' from='buddy1@localhost/laptop' type='chat'>"
|
||||
"<body>From second resource</body>"
|
||||
"</message>"
|
||||
);
|
||||
@ -200,7 +200,7 @@ new_session_when_message_received_from_different_fulljid(void **state)
|
||||
|
||||
prof_input("/msg buddy1@localhost Outgoing 2");
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"buddy1@localhost/laptop\" type=\"chat\">"
|
||||
"<message id='*' to='buddy1@localhost/laptop' type='chat'>"
|
||||
"<body>Outgoing 2</body>"
|
||||
"</message>"
|
||||
));
|
||||
|
@ -17,7 +17,7 @@ connect_jid_requests_roster(void **state)
|
||||
prof_connect();
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"*\" type=\"get\"><query xmlns=\"jabber:iq:roster\"/></iq>"
|
||||
"<iq id='*' type='get'><query xmlns='jabber:iq:roster'/></iq>"
|
||||
));
|
||||
}
|
||||
|
||||
@ -27,8 +27,8 @@ connect_jid_sends_presence_after_receiving_roster(void **state)
|
||||
prof_connect();
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"*\">"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<presence id='*'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
}
|
||||
@ -39,9 +39,9 @@ connect_jid_requests_bookmarks(void **state)
|
||||
prof_connect();
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"*\" type=\"get\">"
|
||||
"<query xmlns=\"jabber:iq:private\">"
|
||||
"<storage xmlns=\"storage:bookmarks\"/>"
|
||||
"<iq id='*' type='get'>"
|
||||
"<query xmlns='jabber:iq:private'>"
|
||||
"<storage xmlns='storage:bookmarks'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
));
|
||||
@ -62,7 +62,7 @@ connect_shows_presence_updates(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<show>dnd</show>"
|
||||
"<status>busy!</status>"
|
||||
"</presence>"
|
||||
@ -70,7 +70,7 @@ connect_shows_presence_updates(void **state)
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is dnd, \"busy!\""));
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/laptop'>"
|
||||
"<show>chat</show>"
|
||||
"<status>Talk to me!</status>"
|
||||
"</presence>"
|
||||
@ -78,7 +78,7 @@ connect_shows_presence_updates(void **state)
|
||||
assert_true(prof_output_exact("Buddy1 (laptop) is chat, \"Talk to me!\""));
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy2@localhost/work\">"
|
||||
"<presence to='stabber@localhost' from='buddy2@localhost/work'>"
|
||||
"<show>away</show>"
|
||||
"<status>Out of office</status>"
|
||||
"</presence>"
|
||||
@ -86,7 +86,7 @@ connect_shows_presence_updates(void **state)
|
||||
assert_true(prof_output_exact("Buddy2 (work) is away, \"Out of office\""));
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<show>xa</show>"
|
||||
"<status>Gone :(</status>"
|
||||
"</presence>"
|
||||
|
@ -19,7 +19,7 @@ message_send(void **state)
|
||||
prof_input("/msg somejid@someserver.com Hi there");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"somejid@someserver.com\" type=\"chat\">"
|
||||
"<message id='*' to='somejid@someserver.com' type='chat'>"
|
||||
"<body>Hi there</body>"
|
||||
"</message>"
|
||||
));
|
||||
@ -33,7 +33,7 @@ message_receive_console(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<message id=\"message1\" to=\"stabber@localhost\" from=\"someuser@chatserv.org/laptop\" type=\"chat\">"
|
||||
"<message id='message1' to='stabber@localhost' from='someuser@chatserv.org/laptop' type='chat'>"
|
||||
"<body>How are you?</body>"
|
||||
"</message>"
|
||||
);
|
||||
@ -47,10 +47,10 @@ message_receive_chatwin(void **state)
|
||||
prof_connect();
|
||||
|
||||
prof_input("/msg someuser@chatserv.org");
|
||||
prof_output_exact("someuser@chatserv.org");
|
||||
assert_true(prof_output_exact("someuser@chatserv.org"));
|
||||
|
||||
stbbr_send(
|
||||
"<message id=\"message1\" to=\"stabber@localhost\" from=\"someuser@chatserv.org/laptop\" type=\"chat\">"
|
||||
"<message id='message1' to='stabber@localhost' from='someuser@chatserv.org/laptop' type='chat'>"
|
||||
"<body>How are you?</body>"
|
||||
"</message>"
|
||||
);
|
||||
|
@ -19,9 +19,9 @@ sends_room_join(void **state)
|
||||
prof_input("/join testroom@conference.localhost");
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
"<presence id=\"*\" to=\"testroom@conference.localhost/stabber\">"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc\"/>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<presence id='*' to='testroom@conference.localhost/stabber'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
}
|
||||
@ -34,9 +34,9 @@ sends_room_join_with_default_muc_service(void **state)
|
||||
prof_input("/join testroom");
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
"<presence id=\"*\" to=\"testroom@conference.localhost/stabber\">"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc\"/>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<presence id='*' to='testroom@conference.localhost/stabber'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
}
|
||||
@ -49,9 +49,9 @@ sends_room_join_with_nick(void **state)
|
||||
prof_input("/join testroom@conference.localhost nick testnick");
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
"<presence id=\"*\" to=\"testroom@conference.localhost/testnick\">"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc\"/>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<presence id='*' to='testroom@conference.localhost/testnick'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
}
|
||||
@ -64,11 +64,11 @@ sends_room_join_with_password(void **state)
|
||||
prof_input("/join testroom@conference.localhost password testpassword");
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
"<presence id=\"*\" to=\"testroom@conference.localhost/stabber\">"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc\">"
|
||||
"<presence id='*' to='testroom@conference.localhost/stabber'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'>"
|
||||
"<password>testpassword</password>"
|
||||
"</x>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
}
|
||||
@ -81,11 +81,11 @@ sends_room_join_with_nick_and_password(void **state)
|
||||
prof_input("/join testroom@conference.localhost nick testnick password testpassword");
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
"<presence id=\"*\" to=\"testroom@conference.localhost/testnick\">"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc\">"
|
||||
"<presence id='*' to='testroom@conference.localhost/testnick'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'>"
|
||||
"<password>testpassword</password>"
|
||||
"</x>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
}
|
||||
@ -96,12 +96,12 @@ shows_role_and_affiliation_on_join(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_2",
|
||||
"<presence id=\"prof_join_2\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/stabber\">"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" node=\"http://www.profanity.im\" ver=\"*\"/>"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
|
||||
"<item role=\"participant\" jid=\"stabber@localhost/profanity\" affiliation=\"none\"/>"
|
||||
"<presence id='prof_join_2' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
"</x>"
|
||||
"<status code=\"110\"/>"
|
||||
"<status code='110'/>"
|
||||
"</presence>"
|
||||
);
|
||||
|
||||
@ -116,12 +116,12 @@ shows_subject_on_join(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_2",
|
||||
"<presence id=\"prof_join_2\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/stabber\">"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" node=\"http://www.profanity.im\" ver=\"*\"/>"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
|
||||
"<item role=\"participant\" jid=\"stabber@localhost/profanity\" affiliation=\"none\"/>"
|
||||
"<presence id='prof_join_2' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
"</x>"
|
||||
"<status code=\"110\"/>"
|
||||
"<status code='110'/>"
|
||||
"</presence>"
|
||||
);
|
||||
|
||||
@ -129,7 +129,7 @@ shows_subject_on_join(void **state)
|
||||
assert_true(prof_output_exact("-> You have joined the room as stabber, role: participant, affiliation: none"));
|
||||
|
||||
stbbr_send(
|
||||
"<message type=\"groupchat\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost\">"
|
||||
"<message type='groupchat' to='stabber@localhost/profanity' from='testroom@conference.localhost'>"
|
||||
"<subject>Test room subject</subject>"
|
||||
"<body>anothernick has set the subject to: Test room subject</body>"
|
||||
"</message>"
|
||||
@ -144,12 +144,12 @@ shows_history_message(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_2",
|
||||
"<presence id=\"prof_join_2\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/stabber\">"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" node=\"http://www.profanity.im\" ver=\"*\"/>"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
|
||||
"<item role=\"participant\" jid=\"stabber@localhost/profanity\" affiliation=\"none\"/>"
|
||||
"<presence id='prof_join_2' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
"</x>"
|
||||
"<status code=\"110\"/>"
|
||||
"<status code='110'/>"
|
||||
"</presence>"
|
||||
);
|
||||
|
||||
@ -157,10 +157,10 @@ shows_history_message(void **state)
|
||||
assert_true(prof_output_exact("-> You have joined the room as stabber, role: participant, affiliation: none"));
|
||||
|
||||
stbbr_send(
|
||||
"<message type=\"groupchat\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/testoccupant\">"
|
||||
"<message type='groupchat' to='stabber@localhost/profanity' from='testroom@conference.localhost/testoccupant'>"
|
||||
"<body>an old message</body>"
|
||||
"<delay xmlns=\"urn:xmpp:delay\" stamp=\"2015-12-19T23:55:25Z\" from=\"testroom@conference.localhost\"/>"
|
||||
"<x xmlns=\"jabber:x:delay\" stamp=\"20151219T23:55:25\"/>"
|
||||
"<delay xmlns='urn:xmpp:delay' stamp='2015-12-19T23:55:25Z' from='testroom@conference.localhost'/>"
|
||||
"<x xmlns='jabber:x:delay' stamp='20151219T23:55:25'/>"
|
||||
"</message>"
|
||||
);
|
||||
|
||||
@ -173,12 +173,12 @@ shows_occupant_join(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_2",
|
||||
"<presence id=\"prof_join_2\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/stabber\">"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" node=\"http://www.profanity.im\" ver=\"*\"/>"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
|
||||
"<item role=\"participant\" jid=\"stabber@localhost/profanity\" affiliation=\"none\"/>"
|
||||
"<presence id='prof_join_2' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
"</x>"
|
||||
"<status code=\"110\"/>"
|
||||
"<status code='110'/>"
|
||||
"</presence>"
|
||||
);
|
||||
|
||||
@ -186,9 +186,9 @@ shows_occupant_join(void **state)
|
||||
assert_true(prof_output_exact("-> You have joined the room as stabber, role: participant, affiliation: none"));
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/testoccupant\">"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
|
||||
"<item role=\"participant\" jid=\"someuser@someserver.org/work\" affiliation=\"none\"/>"
|
||||
"<presence to='stabber@localhost/profanity' from='testroom@conference.localhost/testoccupant'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='someuser@someserver.org/work' affiliation='none'/>"
|
||||
"</x>"
|
||||
"</presence>"
|
||||
);
|
||||
@ -202,12 +202,12 @@ shows_message(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_2",
|
||||
"<presence id=\"prof_join_2\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/stabber\">"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" node=\"http://www.profanity.im\" ver=\"*\"/>"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
|
||||
"<item role=\"participant\" jid=\"stabber@localhost/profanity\" affiliation=\"none\"/>"
|
||||
"<presence id='prof_join_2' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
"</x>"
|
||||
"<status code=\"110\"/>"
|
||||
"<status code='110'/>"
|
||||
"</presence>"
|
||||
);
|
||||
|
||||
@ -215,7 +215,7 @@ shows_message(void **state)
|
||||
assert_true(prof_output_exact("-> You have joined the room as stabber, role: participant, affiliation: none"));
|
||||
|
||||
stbbr_send(
|
||||
"<message type=\"groupchat\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/testoccupant\">"
|
||||
"<message type='groupchat' to='stabber@localhost/profanity' from='testroom@conference.localhost/testoccupant'>"
|
||||
"<body>a new message</body>"
|
||||
"</message>"
|
||||
);
|
||||
@ -224,17 +224,17 @@ shows_message(void **state)
|
||||
}
|
||||
|
||||
void
|
||||
shows_message_in_console_when_window_not_focussed(void **state)
|
||||
shows_all_messages_in_console_when_window_not_focussed(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_2",
|
||||
"<presence id=\"prof_join_2\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/stabber\">"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" node=\"http://www.profanity.im\" ver=\"*\"/>"
|
||||
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
|
||||
"<item role=\"participant\" jid=\"stabber@localhost/profanity\" affiliation=\"none\"/>"
|
||||
"<presence id='prof_join_2' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
"</x>"
|
||||
"<status code=\"110\"/>"
|
||||
"<status code='110'/>"
|
||||
"</presence>"
|
||||
);
|
||||
|
||||
@ -242,13 +242,102 @@ shows_message_in_console_when_window_not_focussed(void **state)
|
||||
assert_true(prof_output_exact("-> You have joined the room as stabber, role: participant, affiliation: none"));
|
||||
|
||||
prof_input("/win 1");
|
||||
prof_output_exact("Profanity. Type /help for help informatiosn.");
|
||||
assert_true(prof_output_exact("Profanity. Type /help for help information."));
|
||||
|
||||
stbbr_send(
|
||||
"<message type=\"groupchat\" to=\"stabber@localhost/profanity\" from=\"testroom@conference.localhost/testoccupant\">"
|
||||
"<message type='groupchat' to='stabber@localhost/profanity' from='testroom@conference.localhost/testoccupant'>"
|
||||
"<body>a new message</body>"
|
||||
"</message>"
|
||||
);
|
||||
|
||||
assert_true(prof_output_exact("<< room message: testoccupant in testroom@conference.localhost (win 2)"));
|
||||
|
||||
stbbr_send(
|
||||
"<message type='groupchat' to='stabber@localhost/profanity' from='testroom@conference.localhost/anotheroccupant'>"
|
||||
"<body>some other message</body>"
|
||||
"</message>"
|
||||
);
|
||||
|
||||
assert_true(prof_output_exact("<< room message: anotheroccupant in testroom@conference.localhost (win 2)"));
|
||||
}
|
||||
|
||||
void
|
||||
shows_first_message_in_console_when_window_not_focussed(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
prof_input("/console muc first");
|
||||
assert_true(prof_output_exact("Console MUC messages set: first"));
|
||||
|
||||
stbbr_for_id("prof_join_2",
|
||||
"<presence id='prof_join_2' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
"</x>"
|
||||
"<status code='110'/>"
|
||||
"</presence>"
|
||||
);
|
||||
|
||||
prof_input("/join testroom@conference.localhost");
|
||||
assert_true(prof_output_exact("-> You have joined the room as stabber, role: participant, affiliation: none"));
|
||||
|
||||
prof_input("/win 1");
|
||||
assert_true(prof_output_exact("Profanity. Type /help for help information."));
|
||||
|
||||
stbbr_send(
|
||||
"<message type='groupchat' to='stabber@localhost/profanity' from='testroom@conference.localhost/testoccupant'>"
|
||||
"<body>a new message</body>"
|
||||
"</message>"
|
||||
);
|
||||
|
||||
assert_true(prof_output_exact("<< room message: testroom@conference.localhost (win 2)"));
|
||||
prof_input("/clear");
|
||||
prof_input("/about");
|
||||
assert_true(prof_output_exact("Type '/help' to show complete help."));
|
||||
|
||||
stbbr_send(
|
||||
"<message type='groupchat' to='stabber@localhost/profanity' from='testroom@conference.localhost/anotheroccupant'>"
|
||||
"<body>some other message</body>"
|
||||
"</message>"
|
||||
);
|
||||
|
||||
prof_timeout(2);
|
||||
assert_false(prof_output_exact("<< room message: testroom@conference.localhost (win 2)"));
|
||||
prof_timeout_reset();
|
||||
}
|
||||
|
||||
void
|
||||
shows_no_message_in_console_when_window_not_focussed(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
prof_input("/console muc none");
|
||||
assert_true(prof_output_exact("Console MUC messages set: none"));
|
||||
|
||||
stbbr_for_id("prof_join_2",
|
||||
"<presence id='prof_join_2' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://www.profanity.im' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
"</x>"
|
||||
"<status code='110'/>"
|
||||
"</presence>"
|
||||
);
|
||||
|
||||
prof_input("/join testroom@conference.localhost");
|
||||
assert_true(prof_output_exact("-> You have joined the room as stabber, role: participant, affiliation: none"));
|
||||
|
||||
prof_input("/win 1");
|
||||
assert_true(prof_output_exact("Profanity. Type /help for help information."));
|
||||
|
||||
stbbr_send(
|
||||
"<message type='groupchat' to='stabber@localhost/profanity' from='testroom@conference.localhost/testoccupant'>"
|
||||
"<body>a new message</body>"
|
||||
"</message>"
|
||||
);
|
||||
|
||||
prof_timeout(2);
|
||||
assert_false(prof_output_exact("testroom@conference.localhost (win 2)"));
|
||||
prof_timeout_reset();
|
||||
}
|
||||
|
@ -8,4 +8,6 @@ void shows_subject_on_join(void **state);
|
||||
void shows_history_message(void **state);
|
||||
void shows_occupant_join(void **state);
|
||||
void shows_message(void **state);
|
||||
void shows_message_in_console_when_window_not_focussed(void **state);
|
||||
void shows_all_messages_in_console_when_window_not_focussed(void **state);
|
||||
void shows_first_message_in_console_when_window_not_focussed(void **state);
|
||||
void shows_no_message_in_console_when_window_not_focussed(void **state);
|
||||
|
@ -15,26 +15,26 @@ void
|
||||
ping_multiple(void **state)
|
||||
{
|
||||
stbbr_for_id("prof_ping_2",
|
||||
"<iq id=\"prof_ping_2\" type=\"result\" to=\"stabber@localhost/profanity\"/>"
|
||||
"<iq id='prof_ping_2' type='result' to='stabber@localhost/profanity'/>"
|
||||
);
|
||||
stbbr_for_id("prof_ping_3",
|
||||
"<iq id=\"prof_ping_3\" type=\"result\" to=\"stabber@localhost/profanity\"/>"
|
||||
"<iq id='prof_ping_3' type='result' to='stabber@localhost/profanity'/>"
|
||||
);
|
||||
|
||||
prof_connect();
|
||||
|
||||
prof_input("/ping");
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"prof_ping_2\" type=\"get\">"
|
||||
"<ping xmlns=\"urn:xmpp:ping\"/>"
|
||||
"<iq id='prof_ping_2' type='get'>"
|
||||
"<ping xmlns='urn:xmpp:ping'/>"
|
||||
"</iq>"
|
||||
));
|
||||
assert_true(prof_output_exact("Ping response from server"));
|
||||
|
||||
prof_input("/ping");
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"prof_ping_3\" type=\"get\">"
|
||||
"<ping xmlns=\"urn:xmpp:ping\"/>"
|
||||
"<iq id='prof_ping_3' type='get'>"
|
||||
"<ping xmlns='urn:xmpp:ping'/>"
|
||||
"</iq>"
|
||||
));
|
||||
assert_true(prof_output_exact("Ping response from server"));
|
||||
@ -46,12 +46,12 @@ ping_responds(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<iq id=\"pingtest1\" type=\"get\" to=\"stabber@localhost/profanity\" from=\"localhost\">"
|
||||
"<ping xmlns=\"urn:xmpp:ping\"/>"
|
||||
"<iq id='pingtest1' type='get' to='stabber@localhost/profanity' from='localhost'>"
|
||||
"<ping xmlns='urn:xmpp:ping'/>"
|
||||
"</iq>"
|
||||
);
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"pingtest1\" type=\"result\" from=\"stabber@localhost/profanity\" to=\"localhost\"/>"
|
||||
"<iq id='pingtest1' type='result' from='stabber@localhost/profanity' to='localhost'/>"
|
||||
));
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ presence_online(void **state)
|
||||
prof_input("/online");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
//
|
||||
@ -44,9 +44,9 @@ presence_online_with_message(void **state)
|
||||
prof_input("/online \"Hi there\"");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<status>Hi there</status>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -61,9 +61,9 @@ presence_away(void **state)
|
||||
prof_input("/away");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<show>away</show>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -78,10 +78,10 @@ presence_away_with_message(void **state)
|
||||
prof_input("/away \"I'm not here for a bit\"");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<show>away</show>"
|
||||
"<status>I'm not here for a bit</status>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -96,9 +96,9 @@ presence_xa(void **state)
|
||||
prof_input("/xa");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<show>xa</show>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -113,10 +113,10 @@ presence_xa_with_message(void **state)
|
||||
prof_input("/xa \"Gone to the shops\"");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<show>xa</show>"
|
||||
"<status>Gone to the shops</status>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -131,9 +131,9 @@ presence_dnd(void **state)
|
||||
prof_input("/dnd");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<show>dnd</show>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -148,10 +148,10 @@ presence_dnd_with_message(void **state)
|
||||
prof_input("/dnd \"Working\"");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<show>dnd</show>"
|
||||
"<status>Working</status>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -166,9 +166,9 @@ presence_chat(void **state)
|
||||
prof_input("/chat");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<show>chat</show>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -183,10 +183,10 @@ presence_chat_with_message(void **state)
|
||||
prof_input("/chat \"Free to talk\"");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<show>chat</show>"
|
||||
"<status>Free to talk</status>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -201,9 +201,9 @@ presence_set_priority(void **state)
|
||||
prof_input("/priority 25");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<priority>25</priority>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
|
||||
@ -217,20 +217,20 @@ presence_includes_priority(void **state)
|
||||
|
||||
prof_input("/priority 25");
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_2\">"
|
||||
"<presence id='prof_presence_2'>"
|
||||
"<priority>25</priority>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
assert_true(prof_output_exact("Priority set to 25."));
|
||||
|
||||
prof_input("/chat \"Free to talk\"");
|
||||
assert_true(stbbr_received(
|
||||
"<presence id=\"prof_presence_3\">"
|
||||
"<presence id='prof_presence_3'>"
|
||||
"<priority>25</priority>"
|
||||
"<show>chat</show>"
|
||||
"<status>Free to talk</status>"
|
||||
"<c hash=\"sha-1\" xmlns=\"http://jabber.org/protocol/caps\" ver=\"*\" node=\"http://www.profanity.im\"/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://www.profanity.im'/>"
|
||||
"</presence>"
|
||||
));
|
||||
assert_true(prof_output_exact("Status set to chat (priority 25), \"Free to talk\"."));
|
||||
@ -242,7 +242,7 @@ presence_received(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"<status>I'm here</status>"
|
||||
"</presence>"
|
||||
@ -258,7 +258,7 @@ presence_missing_resource_defaults(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost'>"
|
||||
"<priority>15</priority>"
|
||||
"<status>My status</status>"
|
||||
"</presence>"
|
||||
|
@ -21,9 +21,9 @@ send_receipt_request(void **state)
|
||||
prof_input("/msg somejid@someserver.com Hi there");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" type=\"chat\" to=\"somejid@someserver.com\">"
|
||||
"<message id='*' type='chat' to='somejid@someserver.com'>"
|
||||
"<body>Hi there</body>"
|
||||
"<request xmlns=\"urn:xmpp:receipts\"/>"
|
||||
"<request xmlns='urn:xmpp:receipts'/>"
|
||||
"</message>"
|
||||
));
|
||||
}
|
||||
@ -36,15 +36,15 @@ send_receipt_on_request(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_send(
|
||||
"<message id=\"msg12213\" type=\"chat\" to=\"stabber@localhost/profanity\" from=\"someuser@server.org/profanity\">"
|
||||
"<message id='msg12213' type='chat' to='stabber@localhost/profanity' from='someuser@server.org/profanity'>"
|
||||
"<body>Wants a receipt</body>"
|
||||
"<request xmlns=\"urn:xmpp:receipts\"/>"
|
||||
"<request xmlns='urn:xmpp:receipts'/>"
|
||||
"</message>"
|
||||
);
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<message id=\"*\" to=\"someuser@server.org/profanity\">"
|
||||
"<received id=\"msg12213\" xmlns=\"urn:xmpp:receipts\"/>"
|
||||
"<message id='*' to='someuser@server.org/profanity'>"
|
||||
"<received id='msg12213' xmlns='urn:xmpp:receipts'/>"
|
||||
"</message>"
|
||||
));
|
||||
}
|
||||
|
@ -15,10 +15,10 @@ void
|
||||
rooms_query(void **state)
|
||||
{
|
||||
stbbr_for_id("confreq",
|
||||
"<iq id=\"confreq\" type=\"result\" to=\"stabber@localhost/profanity\" from=\"conference.localhost\">"
|
||||
"<query xmlns=\"http://jabber.org/protocol/disco#items\">"
|
||||
"<item jid=\"chatroom@conference.localhost\" name=\"A chat room\"/>"
|
||||
"<item jid=\"hangout@conference.localhost\" name=\"Another chat room\"/>"
|
||||
"<iq id='confreq' type='result' to='stabber@localhost/profanity' from='conference.localhost'>"
|
||||
"<query xmlns='http://jabber.org/protocol/disco#items'>"
|
||||
"<item jid='chatroom@conference.localhost' name='A chat room'/>"
|
||||
"<item jid='hangout@conference.localhost' name='Another chat room'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
);
|
||||
@ -31,8 +31,8 @@ rooms_query(void **state)
|
||||
assert_true(prof_output_exact("hangout@conference.localhost, (Another chat room)"));
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
"<iq id=\"confreq\" to=\"conference.localhost\" type=\"get\">"
|
||||
"<query xmlns=\"http://jabber.org/protocol/disco#items\"/>"
|
||||
"<iq id='confreq' to='conference.localhost' type='get'>"
|
||||
"<query xmlns='http://jabber.org/protocol/disco#items'/>"
|
||||
"</iq>"
|
||||
));
|
||||
}
|
||||
|
@ -17,9 +17,9 @@ sends_new_item(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_query("jabber:iq:roster",
|
||||
"<iq type=\"set\" from=\"stabber@localhost\">"
|
||||
"<query xmlns=\"jabber:iq:roster\">"
|
||||
"<item jid=\"bob@localhost\" subscription=\"none\" name=\"\"/>"
|
||||
"<iq type='set' from='stabber@localhost'>"
|
||||
"<query xmlns='jabber:iq:roster'>"
|
||||
"<item jid='bob@localhost' subscription='none' name=''/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
);
|
||||
@ -27,9 +27,9 @@ sends_new_item(void **state)
|
||||
prof_input("/roster add bob@localhost");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq type=\"set\" id=\"*\">"
|
||||
"<query xmlns=\"jabber:iq:roster\">"
|
||||
"<item jid=\"bob@localhost\" name=\"\"/>"
|
||||
"<iq type='set' id='*'>"
|
||||
"<query xmlns='jabber:iq:roster'>"
|
||||
"<item jid='bob@localhost' name=''/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
));
|
||||
@ -43,9 +43,9 @@ sends_new_item_nick(void **state)
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_query("jabber:iq:roster",
|
||||
"<iq type=\"set\" from=\"stabber@localhost\">"
|
||||
"<query xmlns=\"jabber:iq:roster\">"
|
||||
"<item jid=\"bob@localhost\" subscription=\"none\" name=\"Bobby\"/>"
|
||||
"<iq type='set' from='stabber@localhost'>"
|
||||
"<query xmlns='jabber:iq:roster'>"
|
||||
"<item jid='bob@localhost' subscription='none' name='Bobby'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
);
|
||||
@ -53,9 +53,9 @@ sends_new_item_nick(void **state)
|
||||
prof_input("/roster add bob@localhost Bobby");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq type=\"set\" id=\"*\">"
|
||||
"<query xmlns=\"jabber:iq:roster\">"
|
||||
"<item jid=\"bob@localhost\" name=\"Bobby\"/>"
|
||||
"<iq type='set' id='*'>"
|
||||
"<query xmlns='jabber:iq:roster'>"
|
||||
"<item jid='bob@localhost' name='Bobby'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
));
|
||||
@ -67,14 +67,14 @@ void
|
||||
sends_remove_item(void **state)
|
||||
{
|
||||
prof_connect_with_roster(
|
||||
"<item jid=\"buddy1@localhost\" subscription=\"both\"/>"
|
||||
"<item jid=\"buddy2@localhost\" subscription=\"both\"/>"
|
||||
"<item jid='buddy1@localhost' subscription='both'/>"
|
||||
"<item jid='buddy2@localhost' subscription='both'/>"
|
||||
);
|
||||
|
||||
stbbr_for_query("jabber:iq:roster",
|
||||
"<iq id=\"*\" type=\"set\">"
|
||||
"<query xmlns=\"jabber:iq:roster\">"
|
||||
"<item jid=\"buddy1@localhost\" subscription=\"remove\"/>"
|
||||
"<iq id='*' type='set'>"
|
||||
"<query xmlns='jabber:iq:roster'>"
|
||||
"<item jid='buddy1@localhost' subscription='remove'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
);
|
||||
@ -82,9 +82,9 @@ sends_remove_item(void **state)
|
||||
prof_input("/roster remove buddy1@localhost");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq type=\"set\" id=\"*\">"
|
||||
"<query xmlns=\"jabber:iq:roster\">"
|
||||
"<item jid=\"buddy1@localhost\" subscription=\"remove\"/>"
|
||||
"<iq type='set' id='*'>"
|
||||
"<query xmlns='jabber:iq:roster'>"
|
||||
"<item jid='buddy1@localhost' subscription='remove'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
));
|
||||
@ -96,7 +96,7 @@ void
|
||||
sends_nick_change(void **state)
|
||||
{
|
||||
prof_connect_with_roster(
|
||||
"<item jid=\"buddy1@localhost\" subscription=\"both\"/>"
|
||||
"<item jid='buddy1@localhost' subscription='both'/>"
|
||||
);
|
||||
|
||||
prof_input("/roster nick buddy1@localhost Buddy1");
|
||||
@ -104,9 +104,9 @@ sends_nick_change(void **state)
|
||||
assert_true(prof_output_exact("Nickname for buddy1@localhost set to: Buddy1."));
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq type=\"set\" id=\"*\">"
|
||||
"<query xmlns=\"jabber:iq:roster\">"
|
||||
"<item jid=\"buddy1@localhost\" name=\"Buddy1\"/>"
|
||||
"<iq type='set' id='*'>"
|
||||
"<query xmlns='jabber:iq:roster'>"
|
||||
"<item jid='buddy1@localhost' name='Buddy1'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
));
|
||||
|
@ -16,19 +16,19 @@ send_software_version_request(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"<status>I'm here</status>"
|
||||
"</presence>"
|
||||
);
|
||||
prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"");
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\""));
|
||||
prof_input("/software buddy1@localhost/mobile");
|
||||
|
||||
stbbr_received(
|
||||
"<iq id=\"*\" to=\"buddy1@localhost/mobile\" type=\"get\">"
|
||||
"<query xmlns=\"jabber:iq:version\"/>"
|
||||
assert_true(stbbr_received(
|
||||
"<iq id='*' to='buddy1@localhost/mobile' type='get'>"
|
||||
"<query xmlns='jabber:iq:version'/>"
|
||||
"</iq>"
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
void
|
||||
@ -36,16 +36,16 @@ display_software_version_result(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"<status>I'm here</status>"
|
||||
"</presence>"
|
||||
);
|
||||
prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"");
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\""));
|
||||
|
||||
stbbr_for_query("jabber:iq:version",
|
||||
"<iq id=\"*\" type=\"result\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"buddy1@localhost/mobile\">"
|
||||
"<query xmlns=\"jabber:iq:version\">"
|
||||
"<iq id='*' type='result' lang='en' to='stabber@localhost/profanity' from='buddy1@localhost/mobile'>"
|
||||
"<query xmlns='jabber:iq:version'>"
|
||||
"<name>Profanity</name>"
|
||||
"<version>0.4.7dev.master.2cb2f83</version>"
|
||||
"</query>"
|
||||
@ -63,18 +63,18 @@ shows_message_when_software_version_error(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"<status>I'm here</status>"
|
||||
"</presence>"
|
||||
);
|
||||
prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"");
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\""));
|
||||
|
||||
stbbr_for_query("jabber:iq:version",
|
||||
"<iq id=\"*\" lang=\"en\" type=\"error\" to=\"stabber@localhost/profanity\" from=\"buddy1@localhost/laptop\">"
|
||||
"<query xmlns=\"jabber:iq:version\"/>"
|
||||
"<error code=\"503\" type=\"cancel\">"
|
||||
"<service-unavailable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/>"
|
||||
"<iq id='*' lang='en' type='error' to='stabber@localhost/profanity' from='buddy1@localhost/laptop'>"
|
||||
"<query xmlns='jabber:iq:version'/>"
|
||||
"<error code='503' type='cancel'>"
|
||||
"<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>"
|
||||
"</error>"
|
||||
"</iq>"
|
||||
);
|
||||
@ -89,16 +89,16 @@ display_software_version_result_when_from_domainpart(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost'>"
|
||||
"<priority>10</priority>"
|
||||
"<status>I'm here</status>"
|
||||
"</presence>"
|
||||
);
|
||||
prof_output_exact("Buddy1 is online, \"I'm here\"");
|
||||
assert_true(prof_output_exact("Buddy1 is online, \"I'm here\""));
|
||||
|
||||
stbbr_for_query("jabber:iq:version",
|
||||
"<iq id=\"*\" type=\"result\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"localhost\">"
|
||||
"<query xmlns=\"jabber:iq:version\">"
|
||||
"<iq id='*' type='result' lang='en' to='stabber@localhost/profanity' from='localhost'>"
|
||||
"<query xmlns='jabber:iq:version'>"
|
||||
"<name>Some Gateway</name>"
|
||||
"<version>1.0</version>"
|
||||
"</query>"
|
||||
@ -116,12 +116,12 @@ show_message_in_chat_window_when_no_resource(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"<status>I'm here</status>"
|
||||
"</presence>"
|
||||
);
|
||||
prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"");
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\""));
|
||||
|
||||
prof_input("/msg Buddy1");
|
||||
prof_input("/software");
|
||||
@ -134,24 +134,24 @@ display_software_version_result_in_chat(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
stbbr_send(
|
||||
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
|
||||
"<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
|
||||
"<priority>10</priority>"
|
||||
"<status>I'm here</status>"
|
||||
"</presence>"
|
||||
);
|
||||
prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"");
|
||||
assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\""));
|
||||
prof_input("/msg Buddy1");
|
||||
|
||||
stbbr_send(
|
||||
"<message id=\"message1\" to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\" type=\"chat\">"
|
||||
"<message id='message1' to='stabber@localhost' from='buddy1@localhost/mobile' type='chat'>"
|
||||
"<body>Here's a message</body>"
|
||||
"</message>"
|
||||
);
|
||||
prof_output_exact("Here's a message");
|
||||
assert_true(prof_output_exact("Here's a message"));
|
||||
|
||||
stbbr_for_query("jabber:iq:version",
|
||||
"<iq id=\"*\" type=\"result\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"buddy1@localhost/mobile\">"
|
||||
"<query xmlns=\"jabber:iq:version\">"
|
||||
"<iq id='*' type='result' lang='en' to='stabber@localhost/profanity' from='buddy1@localhost/mobile'>"
|
||||
"<query xmlns='jabber:iq:version'>"
|
||||
"<name>Profanity</name>"
|
||||
"<version>0.4.7dev.master.2cb2f83</version>"
|
||||
"</query>"
|
||||
|
@ -403,6 +403,7 @@ void cons_alert(void) {}
|
||||
void cons_theme_setting(void) {}
|
||||
void cons_privileges_setting(void) {}
|
||||
void cons_beep_setting(void) {}
|
||||
void cons_console_setting(void) {}
|
||||
void cons_flash_setting(void) {}
|
||||
void cons_splash_setting(void) {}
|
||||
void cons_vercheck_setting(void) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user