Moved chat resource to WIN_CHAT type

This commit is contained in:
James Booth
2014-12-10 01:44:32 +00:00
parent 12d0d22ab3
commit 706f31422d
6 changed files with 19 additions and 17 deletions

View File

@@ -1782,9 +1782,9 @@ cmd_execute_default(const char * inp)
} else {
GString *send_recipient = g_string_new(recipient);
ProfWin *current = wins_get_current();
if (current && current->chat_resource) {
if (current && current->wins.chat.chat_resource) {
g_string_append(send_recipient, "/");
g_string_append(send_recipient, current->chat_resource);
g_string_append(send_recipient, current->wins.chat.chat_resource);
}
#ifdef HAVE_LIBOTR

View File

@@ -1151,9 +1151,9 @@ cmd_msg(gchar **args, struct cmd_help_t help)
}
GString *send_jid = g_string_new(usr_jid);
ProfWin *current = wins_get_current();
if (current && current->chat_resource) {
if (current->type == WIN_CHAT && current->wins.chat.chat_resource) {
g_string_append(send_jid, "/");
g_string_append(send_jid, current->chat_resource);
g_string_append(send_jid, current->wins.chat.chat_resource);
}
if (msg != NULL) {
@@ -1574,11 +1574,11 @@ cmd_resource(gchar **args, struct cmd_help_t help)
return TRUE;
}
current->chat_resource = strdup(resource);
current->wins.chat.chat_resource = strdup(resource);
return TRUE;
} else if (g_strcmp0(cmd, "off") == 0) {
FREE_SET_NULL(current->chat_resource);
FREE_SET_NULL(current->wins.chat.chat_resource);
return TRUE;
} else {
cons_show("Usage: %s", help.usage);
@@ -2941,9 +2941,9 @@ cmd_tiny(gchar **args, struct cmd_help_t help)
char *recipient = ui_current_recipient();
GString *send_recipient = g_string_new(recipient);
ProfWin *current = wins_get_current();
if (current && current->chat_resource) {
if (current && current->wins.chat.chat_resource) {
g_string_append(send_recipient, "/");
g_string_append(send_recipient, current->chat_resource);
g_string_append(send_recipient, current->wins.chat.chat_resource);
}
#ifdef HAVE_LIBOTR