#include "misc.h"
#include "levels.h"
+#include "channels.h"
+#include "queries.h"
+
#include "printtext.h"
#include "fe-exec.h"
#include "fe-windows.h"
{
PROCESS_REC *rec;
char *target, *level;
- int notice, signum, interactive;
+ int notice, signum, interactive, target_nick, target_channel;
/* check that there's no unknown options. we allowed them
because signals can be used as options, but there should be
return;
/* common options */
+ target_channel = target_nick = FALSE;
if (g_hash_table_lookup(optlist, "out") != NULL) {
/* redirect output to active channel/query */
if (item == NULL)
cmd_return_error(CMDERR_NOT_JOINED);
- target = item->name;
+ target = item->name;
+ target_channel = IS_CHANNEL(item);
+ target_nick = IS_QUERY(item);
} else if (g_hash_table_lookup(optlist, "msg") != NULL) {
/* redirect output to /msg <nick> */
target = g_hash_table_lookup(optlist, "msg");
rec->id = process_get_new_id();
rec->target = g_strdup(target);
rec->target_win = active_win;
+ rec->target_channel = target_channel;
+ rec->target_nick = target_nick;
rec->args = g_strdup(args);
rec->notice = notice;
rec->silent = g_hash_table_lookup(optlist, "-") != NULL;
server = item != NULL ? item->server :
active_win->active_server;
- str = g_strconcat(rec->target, " ", text, NULL);
+ str = g_strconcat(rec->target_nick ? "-nick " :
+ rec->target_channel ? "-channel " : "",
+ rec->target, " ", text, NULL);
signal_emit(rec->notice ? "command notice" : "command msg",
3, str, server, item);
g_free(str);
unsigned int shell:1; /* start the program via /bin/sh */
unsigned int notice:1; /* send text with /notice, not /msg if target is set */
unsigned int silent:1; /* don't print "process exited with level xx" */
+ unsigned int target_channel:1; /* target is a channel */
+ unsigned int target_nick:1; /* target is a nick */
};
extern GSList *processes;
void window_change_server(WINDOW_REC *window, void *server)
{
+ if (server != NULL && SERVER(server)->disconnected)
+ return;
+
window->active_server = server;
signal_emit("window server changed", 2, window, server);
}
Every packet sent from client to server, with exception of packets for
channels, are encrypted with this session key.
-Channels has their own key that are shared by every client on the channel.
+Channels has a channel key that are shared by every client on the channel.
However, the channel keys are cell specific thus one cell does not know
the channel key of the other cell, even if that key is for same channel.
Channel key is also known by the routers and all servers that has clients
message delivery key with each other and that is used in
the message encryption.
-o Client 1. sends encrypted packet to its server. The packet is
- encrypted with the private message delivery key shared between
- clients.
+o Client 1. sends encrypted packet to its server. The packet header
+ is encrypted with the session key shared between the client and
+ server, and the private message is encrypted with the private
+ message delivery key shared between clients.
o Server determines the destination of the packet and sends the
packet to the router.
.in 6
o Payload Length (2 bytes) - Length of the entire payload.
-o Authentication Method (2) - The method of the authentication.
- The authentication methods are defined in [SILC2] in the
- Connection Auth Request Payload. The NONE authentication
- method SHOULD NOT be used.
+o Authentication Method (2 bytes) - The method of the
+ authentication. The authentication methods are defined
+ in [SILC2] in the Connection Auth Request Payload. The NONE
+ authentication method SHOULD NOT be used.
o Public Data Length (2 bytes) - Indicates the length of
the Public Data field.
Protocol version MAY provide both major and minor version. Currently
implementations MUST set the protocol version and accept at least the
protocol version as SILC-1.1-<software version>. If new protocol version
-causes in compatibilities with older version the the <minor> versio number
+causes incompatibilities with older version the <minor> version number
MUST be incremented. The <major> is incremented if new protocol version
is fully incompatible.
void silc_buffer_free(SilcBuffer sb)
{
if (sb) {
+#ifdef SILC_DEBUG
memset(sb->head, 'F', sb->truelen);
+#endif
silc_free(sb->head);
silc_free(sb);
}
*
* DESCRIPTION
*
- * String encoding definitions used with the UTF-8 encoding and the
+ * String encoding definitions used with the UTF-8 encoding and
* decoding functions.
*
* SOURCE