diff options
author | James Booth <boothj5@gmail.com> | 2015-01-10 21:07:40 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-01-10 21:07:40 +0000 |
commit | 965e82b35057414f93c75eb038c2402e019a6777 (patch) | |
tree | 08226ed7648bdfa5bf6a04eadf4a4e868bc2b8d9 /src/command/commands.c | |
parent | 7256e49396c4d5f06de591a03c9e455ffa243b2f (diff) | |
download | profani-tty-965e82b35057414f93c75eb038c2402e019a6777.tar.gz |
Added resource override for chat sessions
Diffstat (limited to 'src/command/commands.c')
-rw-r--r-- | src/command/commands.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index 12c6ba48..08bd31cf 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -1203,17 +1203,6 @@ cmd_msg(gchar **args, struct cmd_help_t help) barejid = usr; } - // TODO if msg to current recipient, and resource specified, set resource -// char *resource = NULL; -// ProfWin *current = wins_get_current(); -// if (current->type == WIN_CHAT) { -// ProfChatWin *chatwin = (ProfChatWin*)current; -// assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); -// if ((g_strcmp0(chatwin->barejid, barejid) == 0) && (chatwin->resource)) { -// resource = chatwin->resource; -// } -// } - if (msg != NULL) { #ifdef HAVE_LIBOTR if (otr_is_secure(barejid)) { @@ -1635,10 +1624,12 @@ cmd_resource(gchar **args, struct cmd_help_t help) } chatwin->resource_override = strdup(resource); + chat_session_resource_override(chatwin->barejid, resource); return TRUE; } else if (g_strcmp0(cmd, "off") == 0) { FREE_SET_NULL(chatwin->resource_override); + chat_session_remove(chatwin->barejid); return TRUE; } else { cons_show("Usage: %s", help.usage); |