[cvslog] (2007-04-14 15:21:25 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Sat Apr 14 09:21:28 CST 2007


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2007-04-14 15:21:24 UTC
Commited by: sven

Modified files:
     Doxyfile lib/eggdrop/botnet.c lib/eggdrop/botnet.h
     lib/eggdrop/dns.c lib/eggdrop/partychan.c lib/eggdrop/partychan.h
     lib/eggdrop/partyline.c lib/eggdrop/partyline.h
     lib/eggdrop/partymember.c lib/eggdrop/partymember.h
     lib/eggdrop/script.c lib/eggdrop/script.h lib/eggdrop/socket.c
     lib/eggdrop/string.c lib/eggdrop/string.h lib/eggdrop/users.c
     modules/dccparty/events.c modules/ircparty/events.c
     modules/ircparty/ircparty.c modules/oldbotnet/events.c
     modules/oldbotnet/oldbotnet.c modules/oldbotnet/oldbotnet.h
     modules/perlscript/perlscript.c modules/script/scripttimer.c
     modules/tclscript/tclscript.c modules/telnetparty/events.c
     modules/telnetparty/telnetparty.c src/core_party.c src/terminal.c

Log message:

 * Fixed various compiler warnings about diffent signedness.
 * Added a new bind: bot. Works just like in eggdrop1.6
 * Added a new struct: botnet_entity. This is used in places where a certain
   event might be caused by either a bot or a partyline user.
 * Added backend for botnet broadcasts, botmsgs (zapf) and botbroadcasts
   (zapf-broad).
 * Added oldbotnet support for actchan, zapf and zapf-broad messages.
 * Improved oldbotnet assocs for mapping 1.6 channel numbers to 1.9 channel
   names. Don't send real assoc messages out because the 1.6 assoc module is
   horribly broken.

---------------------- diff included ----------------------
Index: eggdrop1.9/Doxyfile
diff -u eggdrop1.9/Doxyfile:1.3 eggdrop1.9/Doxyfile:1.4
--- eggdrop1.9/Doxyfile:1.3	Sat Jan 13 06:23:39 2007
+++ eggdrop1.9/Doxyfile	Sat Apr 14 10:21:11 2007
@@ -166,6 +166,7 @@
 ALIASES               += "breakable=\par \"Note:\" This bind is stackable and breakable."
 ALIASES               += "noparam=\par \"Parameters:\" None."
 ALIASES               += "noreturn=\return Any return value will be ignored."
+ALIASES               += "format=\par \"Format:\" "
 
 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
 # only. Doxygen will then generate output that is more tailored for C. 
Index: eggdrop1.9/lib/eggdrop/botnet.c
diff -u eggdrop1.9/lib/eggdrop/botnet.c:1.5 eggdrop1.9/lib/eggdrop/botnet.c:1.6
--- eggdrop1.9/lib/eggdrop/botnet.c:1.5	Sat Jan 13 06:23:39 2007
+++ eggdrop1.9/lib/eggdrop/botnet.c	Sat Apr 14 10:21:11 2007
@@ -28,7 +28,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: botnet.c,v 1.5 2007-01-13 12:23:39 sven Exp $";
+static const char rcsid[] = "$Id: botnet.c,v 1.6 2007-04-14 15:21:11 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -101,12 +101,28 @@
  * \param bot The bot that really got disconnected and caused the bots behind it to get lost.
  * \param string Some kind of reason for the disconnect.
  * \stackable
- * \return Any return value will be ignored.
+ * \noreturn
  */
 
 static bind_table_t *BT_disc;
 
 /*!
+ * \bind
+ * Triggered by a message coming from another bot in the botnet. The first
+ * word is the command and the rest becomes the text argument.
+ * \name bot
+ * \flags Ignored.
+ * \match The command.
+ * \param bot The bot the message is from.
+ * \param string The command.
+ * \param string The rest of the line, possibly nothing.
+ * \stackable
+ * \noreturn
+ */
+
+static bind_table_t *BT_bot;
+
+/*!
  * \brief Inits the whole botnet stuff
  *
  * \returns Always 0
@@ -121,9 +137,10 @@
 	botname = default_botname;
 	bot_ht = hash_table_create(NULL, NULL, 13, HASH_TABLE_STRINGS);
 
-	BT_request_link = bind_table_add(BTN_BOTNET_REQUEST_LINK, 2, "Us", MATCH_MASK, BIND_BREAKABLE);
-	BT_link = bind_table_add(BTN_BOTNET_LINK, 1, "B", MATCH_MASK, BIND_STACKABLE);
-	BT_disc = bind_table_add(BTN_BOTNET_DISC, 3, "BBs", MATCH_MASK, BIND_STACKABLE);
+	BT_request_link = bind_table_add(BTN_BOTNET_REQUEST_LINK, 2, "Us", 0, BIND_BREAKABLE);
+	BT_link = bind_table_add(BTN_BOTNET_LINK, 1, "B", 0, BIND_STACKABLE);
+	BT_disc = bind_table_add(BTN_BOTNET_DISC, 3, "BBs", 0, BIND_STACKABLE);
+	BT_bot = bind_table_add(BTN_BOTNET_BOT, 2, "Bss", 0, 0);
 	return 0;
 }
 
@@ -143,7 +160,7 @@
 	 * there should be no botnet. But just to make sure ... */
 
 	leaked = botnet_clear_all();
-	if (leaked) putlog(LOG_MISC, "*", "Warning: Some botnet module leaded %d bots. Fix this!", leaked);
+	if (leaked) putlog(LOG_MISC, "*", "Warning: Some botnet module leaked %d bots. Fix this!", leaked);
 
 	bind_table_del(BT_request_link);
 	bind_table_del(BT_link);
@@ -329,7 +346,7 @@
  * If the bot is directly linked, the link is broken and the unlinked event
  * is sent on in all directions.
  *
- * \param from Who did it. Might be a bot.
+ * \param from Who did it.
  * \param bot The bot to get rid of.
  * \param reason Some kind of explanation.
  *
@@ -339,7 +356,7 @@
  * \todo Do some kind of check if we really want the unlink.
  */
 
-int botnet_unlink(partymember_t *from, botnet_bot_t *bot, const char *reason)
+int botnet_unlink(botnet_entity_t *from, botnet_bot_t *bot, const char *reason)
 {
 	char obuf[512];
 
@@ -352,7 +369,7 @@
 	snprintf(obuf, sizeof(obuf), "%s (%s)", reason, from->full_name);
 
 	if (bot->handler && bot->handler->on_lost_bot) bot->handler->on_lost_bot(bot->client_data, bot, obuf);
-	if (from->nick) partymember_msgf(from, 0, _("Unlinked from %s."), bot->name);
+	if (from->what == ENTITY_PARTYMEMBER) partymember_msgf(from->user, 0, _("Unlinked from %s."), bot->name);
 	botnet_delete(bot, reason);
 
 	return 0;
@@ -653,14 +670,29 @@
 	}
 }
 
-void botnet_chanmsg(partychan_t *chan, partymember_t *p, const char *text, int len)
+void botnet_chanmsg(partychan_t *chan, botnet_entity_t *src, const char *text, int len)
+{
+	botnet_bot_t *tmp, *srcbot;
+
+	if (src->what == ENTITY_PARTYMEMBER) srcbot = src->user->bot;
+	else srcbot = src->bot;
+
+	for (tmp = localbot_head; tmp; tmp = tmp->next_local) {
+		if (tmp->flags & BOT_DELETED || (srcbot && tmp == srcbot->direction)) continue;
+		if (tmp->handler && tmp->handler->on_chanmsg) tmp->handler->on_chanmsg(tmp->client_data, chan, src, text, len);
+	}
+}
+
+void botnet_broadcast(botnet_entity_t *src, const char *text, int len)
 {
 	botnet_bot_t *tmp;
 
+	if (len < 0) len = strlen(text);
 	for (tmp = localbot_head; tmp; tmp = tmp->next_local) {
-		if (tmp->flags & BOT_DELETED || (p && p->bot && tmp == p->bot->direction)) continue;
-		if (tmp->handler && tmp->handler->on_chanmsg) tmp->handler->on_chanmsg(tmp->client_data, chan, p, text, len);
+		if (tmp->flags & BOT_DELETED || (src && src->bot && tmp == src->bot->direction)) continue;
+		if (tmp->handler && tmp->handler->on_bcast) tmp->handler->on_bcast(tmp->client_data, src, text, len);
 	}
+	partymember_local_broadcast(src, text, len);
 }
 
 void botnet_member_quit(partymember_t *p, const char *reason, int len)
@@ -672,3 +704,31 @@
 		if (tmp->handler && tmp->handler->on_quit) tmp->handler->on_quit(tmp->client_data, p, reason, len);
 	}
 }
+
+void botnet_botmsg(botnet_bot_t *src, botnet_bot_t *dst, const char *command, const char *text, int len)
+{
+	if (!text) len = 0;
+	else if (len < 0) len = strlen(text);
+
+	if (dst) {
+		botnet_bot_t *dir = dst->direction;
+		if (dir->handler && dir->handler->on_botmsg) dir->handler->on_botmsg(dir->client_data, src, dst, command, text, len);
+		return;
+	}
+	bind_check(BT_bot, NULL, command, command, text);
+}
+
+void botnet_botbroadcast(botnet_bot_t *src, const char *command, const char *text, int len)
+{
+	botnet_bot_t *tmp;
+
+	if (!text) len = 0;
+	else if (len < 0) len = strlen(text);
+
+	bind_check(BT_bot, NULL, command, command, text);
+
+	for (tmp = localbot_head; tmp; tmp = tmp->next_local) {
+		if (tmp->flags & BOT_DELETED || (src && tmp == src->direction)) continue;
+		if (tmp->handler && tmp->handler->on_botbroadcast) tmp->handler->on_botbroadcast(tmp->client_data, src, command, text, len);
+	}
+}
Index: eggdrop1.9/lib/eggdrop/botnet.h
diff -u eggdrop1.9/lib/eggdrop/botnet.h:1.2 eggdrop1.9/lib/eggdrop/botnet.h:1.3
--- eggdrop1.9/lib/eggdrop/botnet.h:1.2	Fri Dec 15 03:30:47 2006
+++ eggdrop1.9/lib/eggdrop/botnet.h	Sat Apr 14 10:21:11 2007
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: botnet.h,v 1.2 2006-12-15 09:30:47 sven Exp $
+ * $Id: botnet.h,v 1.3 2007-04-14 15:21:11 sven Exp $
  */
 
 #ifndef _EGG_BOTNET_H_
@@ -25,22 +25,26 @@
 #define BTN_BOTNET_REQUEST_LINK "request-link"
 #define BTN_BOTNET_LINK "link"
 #define BTN_BOTNET_DISC "disc"
+#define BTN_BOTNET_BOT  "bot"
 
 typedef struct {
 	/* Events that don't depend on a single chan. */
+	int (*on_bcast)(void *client_data, botnet_entity_t *src, const char *text, int len);
 	int (*on_nick)(void *client_data, partymember_t *src, const char *oldnick, const char *newnick);
 	int (*on_quit)(void *client_data, partymember_t *src, const char *text, int len);
 
 	/* Channel events. */
-	int (*on_chanmsg)(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
+	int (*on_chanmsg)(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len);
 	int (*on_join)(void *client_data, partychan_t *chan, partymember_t *src, int netburst);
 	int (*on_part)(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
 
 	/* Botnet events. */
 	int (*on_new_bot)(void *client_data, struct botnet_bot *bot, int netburst);
 	int (*on_lost_bot)(void *client_data, struct botnet_bot *bot, const char *reason);
-	int (*on_unlink)(void *client_data, partymember_t *from, struct botnet_bot *bot, const char *reason);
-	int (*on_botmsg)(void *client_data, ...);
+	int (*on_unlink)(void *client_data, botnet_entity_t *from, struct botnet_bot *bot, const char *reason);
+	int (*on_botmsg)(void *client_data, botnet_bot_t *src, botnet_bot_t *dst, const char *command, const char *text, int len);
+	int (*on_botbroadcast)(void *client_data, botnet_bot_t *src, const char *command, const char *text, int len);
+	int (*on_extension)(void *client_data, botnet_entity_t *src, botnet_bot_t *dst, egg_module_t *mod, const char *cmd, const char *text, int len);
 
 	/* Module/Script responsible for this bot */
 } botnet_handler_t;
@@ -53,7 +57,7 @@
  * module's or script's client_data.
  */
 
-typedef struct botnet_bot {
+struct botnet_bot {
 	char *name;                        //!< The name of the bot.
 	unsigned flags;                    //!< Some flags.
 	user_t *user;                      //!< The user entry for this bot. NULL if it's not local.
@@ -67,7 +71,62 @@
 	struct botnet_bot *next;           //!< Next bot in the list.
 	struct botnet_bot *prev_local;     //!< Previous bot in the list of local bots. NULL if this bot isn't local.
 	struct botnet_bot *next_local;     //!< Next bot in the list of local bots. NULL if this bot isn't local.
-} botnet_bot_t;
+};
+
+#define ENTITY_PARTYMEMBER  1
+#define ENTITY_BOT          2
+
+/*!
+ * \brief Creates an entity from a user.
+ *
+ * This macro can be used to create a ::botnet_entity_t from a ::partymember_t.
+ * This workes only during the initialisation of automatic variables.
+ *
+ * Example:
+ * \code
+ * botnet_entity_t entity = user_entity(some_user);
+ * \endcode
+ */
+
+#define user_entity(user) {ENTITY_PARTYMEMBER, (user), 0, (user)->full_id_name, (user)->full_name, (user)->common_name}
+
+/*!
+ * \brief Creates an entity from a bot.
+ *
+ * This macro can be used to create a ::botnet_entity_t from a ::botnet_bot_t.
+ * This workes only during the initialisation of automatic variables.
+ *
+ * Example:
+ * \code
+ * botnet_entity_t other = bot_entity(some_bot);
+ * botnet_entity_t me = bot_entity(0);
+ * \endcode
+ */
+
+#define bot_entity(bot) {ENTITY_BOT, 0, (bot), (bot) ? (bot)->name : botnet_get_name(), (bot) ? (bot)->name : botnet_get_name(), (bot) ? (bot)->name : botnet_get_name()}
+
+#define set_user_entity(e, u) do {\
+	(e)->what = ENTITY_PARTYMEMBER;\
+	(e)->user = (u);\
+	(e)->full_id_name = (u)->full_id_name;\
+	(e)->full_name = (u)->full_name;\
+	(e)->common_name = (u)->common_name;\
+} while (0)
+
+#define set_bot_entity(e, b) do {\
+	(e)->what = ENTITY_BOT;\
+	(e)->bot = (b);\
+	(e)->full_id_name = (e)->full_name = (e)->common_name = (b) ? (b)->name : botnet_get_name();\
+} while (0)
+
+struct botnet_entity {
+	int what;                          //!< ::ENTITY_PARTYMEMBER or ::ENTITY_BOT
+	partymember_t *user;
+	botnet_bot_t *bot;
+	const char *full_id_name;
+	const char *full_name;
+	const char *common_name;
+};
 
 int botnet_init(void);
 int botnet_shutdown(void);
@@ -79,17 +138,22 @@
 botnet_bot_t *botnet_lookup(const char *name);
 botnet_bot_t *botnet_new(const char *name, user_t *user, botnet_bot_t *uplink, botnet_bot_t *direction, botnet_handler_t *handler, void *client_data, event_owner_t *owner, int netburst);
 void botnet_count_subtree(botnet_bot_t *bot, int *bots, int *members);
+
 int botnet_delete_by_owner(struct egg_module *module, void *script);
 int botnet_delete(botnet_bot_t *bot, const char *reason);
-int botnet_unlink(partymember_t *from, botnet_bot_t *bot, const char *reason);
+int botnet_unlink(botnet_entity_t *from, botnet_bot_t *bot, const char *reason);
 int botnet_link(user_t *user);
 
 void botnet_replay_net(botnet_bot_t *bot);
 int botnet_check_direction(botnet_bot_t *direction, botnet_bot_t *src);
 
+void botnet_broadcast(botnet_entity_t *src, const char *text, int len);
 void botnet_member_join(partychan_t *chan, partymember_t *p, int linking);
 void botnet_member_part(partychan_t *chan, partymember_t *p, const char *reason, int len);
-void botnet_chanmsg(partychan_t *chan, partymember_t *p, const char *reason, int len);
+void botnet_chanmsg(partychan_t *chan, botnet_entity_t *src, const char *reason, int len);
 void botnet_member_quit(partymember_t *p, const char *reason, int len);
+void botnet_botmsg(botnet_bot_t *src, botnet_bot_t *dst, const char *command, const char *text, int len);
+void botnet_botbroadcast(botnet_bot_t *src, const char *command, const char *text, int len);
+void botnet_extension(botnet_entity_t *src, botnet_bot_t *dst, egg_module_t *mod, const char *cmd, const char *text, int len);
 
 #endif /* !_EGG_BOTNET_H_ */
Index: eggdrop1.9/lib/eggdrop/dns.c
diff -u eggdrop1.9/lib/eggdrop/dns.c:1.19 eggdrop1.9/lib/eggdrop/dns.c:1.20
--- eggdrop1.9/lib/eggdrop/dns.c:1.19	Mon Oct  2 23:02:12 2006
+++ eggdrop1.9/lib/eggdrop/dns.c	Sat Apr 14 10:21:11 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: dns.c,v 1.19 2006-10-03 04:02:12 sven Exp $";
+static const char rcsid[] = "$Id: dns.c,v 1.20 2007-04-14 15:21:11 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -671,7 +671,7 @@
 		}
 		#endif
 		if (reply.type == 12) {
-			char *placeholder;
+			unsigned char *placeholder;
 			int len, dot;
 
 			/*fprintf(fp, "reverse-lookup reply\n");*/
@@ -685,7 +685,7 @@
 				else {
 					dot = ptr[len];
 					ptr[len] = 0;
-					strcat(result, ptr);
+					strcat(result, (char *) ptr);
 					strcat(result, ".");
 					ptr[len] = dot;
 					ptr += len;
Index: eggdrop1.9/lib/eggdrop/partychan.c
diff -u eggdrop1.9/lib/eggdrop/partychan.c:1.23 eggdrop1.9/lib/eggdrop/partychan.c:1.24
--- eggdrop1.9/lib/eggdrop/partychan.c:1.23	Tue Nov 14 08:51:23 2006
+++ eggdrop1.9/lib/eggdrop/partychan.c	Sat Apr 14 10:21:11 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: partychan.c,v 1.23 2006-11-14 14:51:23 sven Exp $";
+static const char rcsid[] = "$Id: partychan.c,v 1.24 2007-04-14 15:21:11 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -44,7 +44,7 @@
 	 * channel name, channel id, partier */
 	BT_partyjoin = bind_table_add(BTN_PARTYLINE_JOIN, 3, "siP", MATCH_NONE, BIND_STACKABLE);	/* DDD	*/
 	BT_partypart = bind_table_add(BTN_PARTYLINE_PART, 5, "siPsi", MATCH_NONE, BIND_STACKABLE);	/* DDD	*/
-	BT_partypub = bind_table_add(BTN_PARTYLINE_PUBLIC, 5, "siPsi", MATCH_NONE, BIND_STACKABLE);	/* DDD	*/
+	BT_partypub = bind_table_add(BTN_PARTYLINE_PUBLIC, 5, "siEsi", MATCH_NONE, BIND_STACKABLE);	/* DDD	*/
 	return(0);
 }
 
@@ -347,7 +347,7 @@
 	return(0);
 }
 
-static int chan_msg(partychan_t *chan, partymember_t *src, const char *text, int len, int local)
+static int chan_msg(partychan_t *chan, botnet_entity_t *src, const char *text, int len, int local)
 {
 	partychan_member_t *mem;
 	int i;
@@ -371,7 +371,7 @@
 	return(0);
 }
 
-int partychan_msg_name(const char *name, partymember_t *src, const char *text, int len)
+int partychan_msg_name(const char *name, botnet_entity_t *src, const char *text, int len)
 {
 	partychan_t *chan;
 
@@ -379,7 +379,7 @@
 	return chan_msg(chan, src, text, len, 0);
 }
 
-int partychan_msg_cid(int cid, partymember_t *src, const char *text, int len)
+int partychan_msg_cid(int cid, botnet_entity_t *src, const char *text, int len)
 {
 	partychan_t *chan;
 
@@ -387,12 +387,12 @@
 	return chan_msg(chan, src, text, len, 0);
 }
 
-int partychan_msg(partychan_t *chan, partymember_t *src, const char *text, int len)
+int partychan_msg(partychan_t *chan, botnet_entity_t *src, const char *text, int len)
 {
 	return chan_msg(chan, src, text, len, 0);
 }
 
-int localchan_msg(partychan_t *chan, partymember_t *src, const char *text, int len)
+int localchan_msg(partychan_t *chan, botnet_entity_t *src, const char *text, int len)
 {
 	return chan_msg(chan, src, text, len, 1);
 }
Index: eggdrop1.9/lib/eggdrop/partychan.h
diff -u eggdrop1.9/lib/eggdrop/partychan.h:1.4 eggdrop1.9/lib/eggdrop/partychan.h:1.5
--- eggdrop1.9/lib/eggdrop/partychan.h:1.4	Tue Nov 14 08:51:23 2006
+++ eggdrop1.9/lib/eggdrop/partychan.h	Sat Apr 14 10:21:11 2007
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: partychan.h,v 1.4 2006-11-14 14:51:23 sven Exp $
+ * $Id: partychan.h,v 1.5 2007-04-14 15:21:11 sven Exp $
  */
 
 #ifndef _EGG_PARTYCHAN_H
@@ -60,10 +60,10 @@
 int partychan_part_name(const char *chan, partymember_t *p, const char *text);
 int partychan_part_cid(int cid, partymember_t *p, const char *text);
 int partychan_part(partychan_t *chan, partymember_t *p, const char *text);
-int partychan_msg_name(const char *name, partymember_t *src, const char *text, int len);
-int partychan_msg_cid(int cid, partymember_t *src, const char *text, int len);
-int partychan_msg(partychan_t *chan, partymember_t *src, const char *text, int len);
-int localchan_msg(partychan_t *chan, partymember_t *src, const char *text, int len);
+int partychan_msg_name(const char *name, botnet_entity_t *src, const char *text, int len);
+int partychan_msg_cid(int cid, botnet_entity_t *src, const char *text, int len);
+int partychan_msg(partychan_t *chan, botnet_entity_t *src, const char *text, int len);
+int localchan_msg(partychan_t *chan, botnet_entity_t *src, const char *text, int len);
 partymember_common_t *partychan_get_common(partymember_t *p);
 int partychan_free_common(partymember_common_t *common);
 
Index: eggdrop1.9/lib/eggdrop/partyline.c
diff -u eggdrop1.9/lib/eggdrop/partyline.c:1.27 eggdrop1.9/lib/eggdrop/partyline.c:1.28
--- eggdrop1.9/lib/eggdrop/partyline.c:1.27	Tue Nov 14 08:51:23 2006
+++ eggdrop1.9/lib/eggdrop/partyline.c	Sat Apr 14 10:21:11 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: partyline.c,v 1.27 2006-11-14 14:51:23 sven Exp $";
+static const char rcsid[] = "$Id: partyline.c,v 1.28 2007-04-14 15:21:11 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -110,7 +110,8 @@
 		}
 	}
 	/* It's not a command, so it's public text. */
-	partychan_msg(chan, p, text, len);
+	botnet_entity_t src = user_entity(p);
+	partychan_msg(chan, &src, text, len);
 	return(0);
 }
 
@@ -230,7 +231,7 @@
 	return(0);
 }
 
-int partyline_idx_privmsg(int idx, partymember_t *dest, partymember_t *src, const char *text, int len)
+int partyline_idx_privmsg(int idx, partymember_t *dest, botnet_entity_t *src, const char *text, int len)
 {
 	char *ts;
 
@@ -261,7 +262,7 @@
 	return 0;
 }
 
-int partyline_idx_chanmsg(int idx, partychan_t *chan, partymember_t *src, const char *text, int len)
+int partyline_idx_chanmsg(int idx, partychan_t *chan, botnet_entity_t *src, const char *text, int len)
 {
 	char *ts;
 
Index: eggdrop1.9/lib/eggdrop/partyline.h
diff -u eggdrop1.9/lib/eggdrop/partyline.h:1.25 eggdrop1.9/lib/eggdrop/partyline.h:1.26
--- eggdrop1.9/lib/eggdrop/partyline.h:1.25	Tue Nov 14 08:51:23 2006
+++ eggdrop1.9/lib/eggdrop/partyline.h	Sat Apr 14 10:21:12 2007
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: partyline.h,v 1.25 2006-11-14 14:51:23 sven Exp $
+ * $Id: partyline.h,v 1.26 2007-04-14 15:21:12 sven Exp $
  */
 
 #ifndef _EGG_PARTYLINE_H_
@@ -36,7 +36,8 @@
 #define BTN_PARTYLINE_CMD	"party"
 #define BTN_PARTYLINE_OUT	"party_out"
 
-struct botnet_bot;
+typedef struct botnet_bot botnet_bot_t;
+typedef struct botnet_entity botnet_entity_t;
 typedef struct partymember partymember_t;
 typedef struct partychan partychan_t;
 typedef struct partychan_member partychan_member_t;
@@ -45,21 +46,21 @@
 
 struct partyline_event {
 	/* Events that don't depend on a single chan. */
-	int (*on_privmsg)(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len);
+	int (*on_privmsg)(void *client_data, partymember_t *dest, botnet_entity_t *src, const char *text, int len);
 	int (*on_nick)(void *client_data, partymember_t *src, const char *oldnick, const char *newnick);
 	int (*on_quit)(void *client_data, partymember_t *src, const struct botnet_bot *bot, const char *text, int len);
 
 	/* Channel events. */
-	int (*on_chanmsg)(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
+	int (*on_chanmsg)(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len);
 	int (*on_join)(void *client_data, partychan_t *chan, partymember_t *src, int linking);
 	int (*on_part)(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
 };
 
 /* helper handler for partyline events to reduce work in e.g. telnetparty module. */
-int partyline_idx_privmsg(int idx,  partymember_t *dest, partymember_t *src, const char *text, int len);
+int partyline_idx_privmsg(int idx,  partymember_t *dest, botnet_entity_t *src, const char *text, int len);
 int partyline_idx_nick(int idx, partymember_t *src, const char *oldnick, const char *newnick);
 int partyline_idx_quit(int idx, partymember_t *src, const char *text, int len);
-int partyline_idx_chanmsg(int idx, partychan_t *chan, partymember_t *src, const char *text, int len);
+int partyline_idx_chanmsg(int idx, partychan_t *chan, botnet_entity_t *src, const char *text, int len);
 int partyline_idx_join(int idx, partychan_t *chan, partymember_t *src);
 int partyline_idx_part(int idx, partychan_t *chan, partymember_t *src, const char *text, int len);
 
Index: eggdrop1.9/lib/eggdrop/partymember.c
diff -u eggdrop1.9/lib/eggdrop/partymember.c:1.24 eggdrop1.9/lib/eggdrop/partymember.c:1.25
--- eggdrop1.9/lib/eggdrop/partymember.c:1.24	Sat Jan 13 06:23:39 2007
+++ eggdrop1.9/lib/eggdrop/partymember.c	Sat Apr 14 10:21:12 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: partymember.c,v 1.24 2007-01-13 12:23:39 sven Exp $";
+static const char rcsid[] = "$Id: partymember.c,v 1.25 2007-04-14 15:21:12 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -332,7 +332,7 @@
 	return partymember_msg(p, NULL, text, len);
 }
 
-int partymember_msg(partymember_t *p, partymember_t *src, const char *text, int len)
+int partymember_msg(partymember_t *p, botnet_entity_t *src, const char *text, int len)
 {
 	if (!p || p->flags & PARTY_DELETED) return(-1);
 
@@ -342,6 +342,18 @@
 	return(0);
 }
 
+int partymember_local_broadcast(botnet_entity_t *src, const char *text, int len)
+{
+	partymember_t *p;
+
+	if (len < 0) len = strlen(text);
+	for (p = local_party_head; p; p = p->next_on_bot) {
+		if (p->flags & PARTY_DELETED) continue;
+		partymember_msg(p, src, text, len);
+	}
+	return 0;
+}
+
 /*int partymember_printf_id(int id, const char *fmt, ...)
 {
 	va_list args;
@@ -374,7 +386,7 @@
 	return(0);
 }
 
-int partymember_msgf(partymember_t *p, partymember_t *src, const char *fmt, ...)
+int partymember_msgf(partymember_t *p, botnet_entity_t *src, const char *fmt, ...)
 {
 	va_list args;
 	char *ptr, buf[1024];
@@ -394,7 +406,7 @@
 {
 	partymember_t *p;
 
-	for (p = local_party_head; p; p = p->next) {
+	for (p = local_party_head; p; p = p->next_on_bot) {
 		if (p->user == u) partymember_delete(p, NULL, "User deleted!");
 	}
 	return(0);
Index: eggdrop1.9/lib/eggdrop/partymember.h
diff -u eggdrop1.9/lib/eggdrop/partymember.h:1.6 eggdrop1.9/lib/eggdrop/partymember.h:1.7
--- eggdrop1.9/lib/eggdrop/partymember.h:1.6	Sat Jan 13 06:23:40 2007
+++ eggdrop1.9/lib/eggdrop/partymember.h	Sat Apr 14 10:21:12 2007
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: partymember.h,v 1.6 2007-01-13 12:23:40 sven Exp $
+ * $Id: partymember.h,v 1.7 2007-04-14 15:21:12 sven Exp $
  */
 
 #ifndef _EGG_PARTYMEMBER_H
@@ -55,11 +55,12 @@
 int partymember_who(int **ids, int *len);
 int partymember_write_id(int id, const char *text, int len);
 int partymember_write(partymember_t *p, const char *text, int len);
-int partymember_msg(partymember_t *p, partymember_t *src, const char *text, int len);
-int partymember_msgf(partymember_t *p, partymember_t *src, const char *fmt, ...);
+int partymember_msg(partymember_t *p, botnet_entity_t *src, const char *text, int len);
+int partymember_msgf(partymember_t *p, botnet_entity_t *src, const char *fmt, ...);
 int partymember_printf_id(int id, const char *fmt, ...);
 int partymember_printf(partymember_t *p, const char *fmt, ...);
 int partymember_set_nick(partymember_t *p, const char *nick);
+int partymember_local_broadcast(botnet_entity_t *src, const char *text, int len);
 
 int partymember_count_by_bot(const struct botnet_bot *bot);
 int partymember_delete_by_bot(const struct botnet_bot *bot, const struct botnet_bot *lost_bot, const char *reason);
Index: eggdrop1.9/lib/eggdrop/script.c
diff -u eggdrop1.9/lib/eggdrop/script.c:1.26 eggdrop1.9/lib/eggdrop/script.c:1.27
--- eggdrop1.9/lib/eggdrop/script.c:1.26	Sat Jan 13 06:23:40 2007
+++ eggdrop1.9/lib/eggdrop/script.c	Sat Apr 14 10:21:12 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: script.c,v 1.26 2007-01-13 12:23:40 sven Exp $";
+static const char rcsid[] = "$Id: script.c,v 1.27 2007-04-14 15:21:12 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -35,7 +35,7 @@
 typedef struct {
 	script_callback_t *callback;
 	int id;
-	char *text;
+	unsigned char *text;
 	int len;
 } script_dns_callback_data_t;
 
@@ -572,6 +572,7 @@
 
 static int script_dns_callback(void *client_data, const char *query, char **result)
 {
+	static unsigned char no_data = 0;
 	byte_array_t bytes;
 	script_dns_callback_data_t *data = client_data;
 
@@ -579,8 +580,8 @@
 	bytes.len = data->len;
 	bytes.do_free = 0;
 
-	if (!bytes.bytes) bytes.bytes = "";
-	if (bytes.len <= 0) bytes.len = strlen(bytes.bytes);
+	if (!bytes.bytes) bytes.bytes = &no_data;
+	if (bytes.len <= 0) bytes.len = strlen((char *) bytes.bytes);
 
 	data->callback->callback(data->callback, data->id, query, result, &bytes);
 
Index: eggdrop1.9/lib/eggdrop/script.h
diff -u eggdrop1.9/lib/eggdrop/script.h:1.20 eggdrop1.9/lib/eggdrop/script.h:1.21
--- eggdrop1.9/lib/eggdrop/script.h:1.20	Tue Nov 14 08:51:23 2006
+++ eggdrop1.9/lib/eggdrop/script.h	Sat Apr 14 10:21:12 2007
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: script.h,v 1.20 2006-11-14 14:51:23 sven Exp $
+ * $Id: script.h,v 1.21 2007-04-14 15:21:12 sven Exp $
  */
 
 #ifndef _EGG_SCRIPT_H_
@@ -110,8 +110,10 @@
 #define SCRIPT_USER		      'U'
 #define SCRIPT_BOT          'B'
 #define SCRIPT_PARTIER		  'P'
+#define SCRIPT_ENTITY       'E'
 #define SCRIPT_BYTES		    'b'
 #define SCRIPT_VAR		      'v'
+#define SCRIPT_OBJECT       'o'
 #define SCRIPT_TYPE_MASK	  255
 
 typedef struct script_callback_b {
Index: eggdrop1.9/lib/eggdrop/socket.c
diff -u eggdrop1.9/lib/eggdrop/socket.c:1.13 eggdrop1.9/lib/eggdrop/socket.c:1.14
--- eggdrop1.9/lib/eggdrop/socket.c:1.13	Fri Aug 25 12:22:50 2006
+++ eggdrop1.9/lib/eggdrop/socket.c	Sat Apr 14 10:21:12 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: socket.c,v 1.13 2006-08-25 17:22:50 sven Exp $";
+static const char rcsid[] = "$Id: socket.c,v 1.14 2007-04-14 15:21:12 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -89,7 +89,7 @@
 int socket_get_name(int sock, char **ip, int *port)
 {
 	sockname_t name;
-	int namelen;
+	socklen_t namelen;
 
 	if (ip) *ip = NULL;
 	if (port) *port = 0;
@@ -130,7 +130,7 @@
 int socket_get_peer_name(int sock, char **peer_ip, int *peer_port)
 {
 	sockname_t name;
-	int namelen;
+	socklen_t namelen;
 
 	if (peer_ip) *peer_ip = NULL;
 	if (peer_port) *peer_port = 0;
@@ -163,7 +163,8 @@
 
 int socket_get_error(int sock)
 {
-	int size, err;
+	int err;
+	socklen_t size;
 
 	if (sock < 0) return(0);
 
@@ -175,8 +176,9 @@
 
 int socket_accept(int sock, char **peer_ip, int *peer_port)
 {
-	int newsock, len;
+	int newsock;
 	sockname_t name;
+	socklen_t len;
 
 	*peer_ip = NULL;
 	*peer_port = 0;
Index: eggdrop1.9/lib/eggdrop/string.c
diff -u eggdrop1.9/lib/eggdrop/string.c:1.4 eggdrop1.9/lib/eggdrop/string.c:1.5
--- eggdrop1.9/lib/eggdrop/string.c:1.4	Wed Dec 22 18:12:34 2004
+++ eggdrop1.9/lib/eggdrop/string.c	Sat Apr 14 10:21:12 2007
@@ -18,15 +18,15 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: string.c,v 1.4 2004-12-23 00:12:34 lordares Exp $";
+static const char rcsid[] = "$Id: string.c,v 1.5 2007-04-14 15:21:12 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>				/* egg_return_val_if_fail	*/
 
-int egg_get_word(const unsigned char *text, const char **next, char **word)
+int egg_get_word(const char *text, const char **next, char **word)
 {
 	int len;
-	const unsigned char *ptr;
+	const char *ptr;
 
 	if (!word || !text) {
 		if (next) *next = NULL;
@@ -48,7 +48,7 @@
 	return(0);
 }
 
-int egg_get_arg(const unsigned char *text, const char **next, char **arg)
+int egg_get_arg(const char *text, const char **next, char **arg)
 {
 	int len = 0, max = 64, inquote = 0, insingle = 0, n, done;
 
Index: eggdrop1.9/lib/eggdrop/string.h
diff -u eggdrop1.9/lib/eggdrop/string.h:1.4 eggdrop1.9/lib/eggdrop/string.h:1.5
--- eggdrop1.9/lib/eggdrop/string.h:1.4	Wed Dec 22 18:12:34 2004
+++ eggdrop1.9/lib/eggdrop/string.h	Sat Apr 14 10:21:12 2007
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: string.h,v 1.4 2004-12-23 00:12:34 lordares Exp $
+ * $Id: string.h,v 1.5 2007-04-14 15:21:12 sven Exp $
  */
 
 #ifndef _EGG_STRING_H_
@@ -26,8 +26,8 @@
 int str_starts_with(const char *text, const char *str);
 void str_tolower(char *str);
 
-int egg_get_word(const unsigned char *text, const char **next, char **word);
-int egg_get_arg(const unsigned char *text, const char **next, char **arg);
+int egg_get_word(const char *text, const char **next, char **word);
+int egg_get_arg(const char *text, const char **next, char **arg);
 int egg_get_words(const char *text, const char **next, char **word, ...);
 int egg_get_args(const char *text, const char **next, char **arg, ...);
 int egg_get_word_array(const char *text, const char **next, char **words, int nwords);
Index: eggdrop1.9/lib/eggdrop/users.c
diff -u eggdrop1.9/lib/eggdrop/users.c:1.53 eggdrop1.9/lib/eggdrop/users.c:1.54
--- eggdrop1.9/lib/eggdrop/users.c:1.53	Fri Dec 15 03:30:47 2006
+++ eggdrop1.9/lib/eggdrop/users.c	Sat Apr 14 10:21:12 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: users.c,v 1.53 2006-12-15 09:30:47 sven Exp $";
+static const char rcsid[] = "$Id: users.c,v 1.54 2007-04-14 15:21:12 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -713,7 +713,8 @@
 
 int user_check_pass(user_t *u, const char *pass)
 {
-	char *hash, *salt, test[16], testhex[33];
+	char *hash, *salt, testhex[33];
+	unsigned char test[16];
 	MD5_CTX ctx;
 
 	user_get_setting(u, NULL, "pass", &hash);
@@ -730,7 +731,8 @@
 
 int user_set_pass(user_t *u, const char *pass)
 {
-	char hash[16], hashhex[33], *salt, new_salt[33];
+	char hashhex[33], *salt, new_salt[33];
+	unsigned char hash[16];
 	MD5_CTX ctx;
 
 	user_get_setting(u, NULL, "salt", &salt);
Index: eggdrop1.9/modules/dccparty/events.c
diff -u eggdrop1.9/modules/dccparty/events.c:1.8 eggdrop1.9/modules/dccparty/events.c:1.9
--- eggdrop1.9/modules/dccparty/events.c:1.8	Sat Jan 13 06:23:40 2007
+++ eggdrop1.9/modules/dccparty/events.c	Sat Apr 14 10:21:12 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: events.c,v 1.8 2007-01-13 12:23:40 sven Exp $";
+static const char rcsid[] = "$Id: events.c,v 1.9 2007-04-14 15:21:12 sven Exp $";
 #endif
 
 #include <string.h>
@@ -27,10 +27,10 @@
 
 #include "dccparty.h"
 
-static int on_privmsg(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len);
+static int on_privmsg(void *client_data, partymember_t *dest, botnet_entity_t *src, const char *text, int len);
 static int on_nick(void *client_data, partymember_t *src, const char *oldnick, const char *newnick);
 static int on_quit(void *client_data, partymember_t *src, const botnet_bot_t *lostbot, const char *text, int len);
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len);
 static int on_join(void *client_data, partychan_t *chan, partymember_t *src, int linking);
 static int on_part(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
 
@@ -43,7 +43,7 @@
 	on_part
 };
 
-static int on_privmsg(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len)
+static int on_privmsg(void *client_data, partymember_t *dest, botnet_entity_t *src, const char *text, int len)
 {
 	dcc_session_t *session = client_data;
 
@@ -78,7 +78,7 @@
 	return(0);
 }
 
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len)
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len)
 {
 	dcc_session_t *session = client_data;
 
Index: eggdrop1.9/modules/ircparty/events.c
diff -u eggdrop1.9/modules/ircparty/events.c:1.10 eggdrop1.9/modules/ircparty/events.c:1.11
--- eggdrop1.9/modules/ircparty/events.c:1.10	Sat Jan 13 06:23:40 2007
+++ eggdrop1.9/modules/ircparty/events.c	Sat Apr 14 10:21:12 2007
@@ -18,17 +18,17 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: events.c,v 1.10 2007-01-13 12:23:40 sven Exp $";
+static const char rcsid[] = "$Id: events.c,v 1.11 2007-04-14 15:21:12 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
 
 #include "ircparty.h"
 
-static int on_privmsg(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len);
+static int on_privmsg(void *client_data, partymember_t *dest, botnet_entity_t *src, const char *text, int len);
 static int on_nick(void *client_data, partymember_t *src, const char *oldnick, const char *newnick);
 static int on_quit(void *client_data, partymember_t *src, const botnet_bot_t *lostbot, const char *text, int len);
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len);
 static int on_join(void *client_data, partychan_t *chan, partymember_t *src, int linking);
 static int on_part(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
 
@@ -41,13 +41,14 @@
 	on_part
 };
 
-static int on_privmsg(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len)
+static int on_privmsg(void *client_data, partymember_t *dest, botnet_entity_t *src, const char *text, int len)
 {
 	irc_session_t *session = client_data;
 
-	if (src && src->nick && src->bot) egg_iprintf(session->idx, ":%s*%s:%d!%s@%s PRIVMSG %s :%s\r\n", src->nick, src->bot->name, src->id, src->ident, src->host, dest->nick, text);
-	else if (src && src->nick) egg_iprintf(session->idx, ":%s:%d!%s@%s PRIVMSG %s :%s\r\n", src->nick, src->id, src->ident, src->host, dest->nick, text); 
-	else if (src) egg_iprintf(session->idx, ":%s!%s@%s PRIVMSG %s :%s\r\n", src->bot->name, src->bot->name, src->bot->name, dest->nick, text);
+	if (src && src->what == ENTITY_PARTYMEMBER && src->user->bot) egg_iprintf(session->idx, ":%s*%s:%d!%s@%s PRIVMSG %s :%s\r\n", src->user->nick, src->user->bot->name, src->user->id, src->user->ident, src->user->host, dest->nick, text);
+	else if (src && src->what == ENTITY_PARTYMEMBER) egg_iprintf(session->idx, ":%s:%d!%s@%s PRIVMSG %s :%s\r\n", src->user->nick, src->user->id, src->user->ident, src->user->host, dest->nick, text); 
+	else if (src && src->bot) egg_iprintf(session->idx, ":%s!%s@%s PRIVMSG %s :%s\r\n", src->bot->name, src->bot->name, src->bot->name, dest->nick, text);
+	else if (src) egg_iprintf(session->idx, ":%s!%s@%s PRIVMSG %s :%s\r\n", botnet_get_name(), botnet_get_name(), botnet_get_name(), dest->nick, text);
 	else egg_iprintf(session->idx, ":* NOTICE * :%s\r\n", text);
 	return(0);
 }
@@ -73,14 +74,15 @@
 	return(0);
 }
 
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len)
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len)
 {
 	irc_session_t *session = client_data;
 
-	if (src == session->party) return 0;
-	if (src && src->nick && src->bot) egg_iprintf(session->idx, ":%s*%s:%d!%s@%s PRIVMSG #%s :%s\r\n", src->nick, src->bot->name, src->id, src->ident, src->host, chan->name, text);
-	else if (src && src->nick) egg_iprintf(session->idx, ":%s:%d!%s@%s PRIVMSG #%s :%s\r\n", src->nick, src->id, src->ident, src->host, chan->name, text);
-	else if (src) egg_iprintf(session->idx, ":%s!%s@%s PRIVMSG #%s :%s\r\n", src->bot->name, src->bot->name, src->bot->name, chan->name, text);
+	if (src->what == ENTITY_PARTYMEMBER && src->user == session->party) return 0;
+	if (src && src->what == ENTITY_PARTYMEMBER && src->user->bot) egg_iprintf(session->idx, ":%s*%s:%d!%s@%s PRIVMSG #%s :%s\r\n", src->user->nick, src->user->bot->name, src->user->id, src->user->ident, src->user->host, chan->name, text);
+	else if (src && src->what == ENTITY_PARTYMEMBER) egg_iprintf(session->idx, ":%s:%d!%s@%s PRIVMSG #%s :%s\r\n", src->user->nick, src->user->id, src->user->ident, src->user->host, chan->name, text);
+	else if (src && src->bot) egg_iprintf(session->idx, ":%s!%s@%s PRIVMSG #%s :%s\r\n", src->user->bot->name, src->user->bot->name, src->user->bot->name, chan->name, text);
+	else if (src) egg_iprintf(session->idx, ":%s!%s@%s PRIVMSG #%s :%s\r\n", botnet_get_name(), botnet_get_name(), botnet_get_name(), chan->name, text);
 	else egg_iprintf(session->idx, ":* PRIVMSG #%s :%s\r\n", chan->name, text);
 	return 0;
 }
Index: eggdrop1.9/modules/ircparty/ircparty.c
diff -u eggdrop1.9/modules/ircparty/ircparty.c:1.18 eggdrop1.9/modules/ircparty/ircparty.c:1.19
--- eggdrop1.9/modules/ircparty/ircparty.c:1.18	Sat Jan 13 06:23:40 2007
+++ eggdrop1.9/modules/ircparty/ircparty.c	Sat Apr 14 10:21:13 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: ircparty.c,v 1.18 2007-01-13 12:23:40 sven Exp $";
+static const char rcsid[] = "$Id: ircparty.c,v 1.19 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -242,9 +242,11 @@
 		else partyline_on_input(partychan_lookup_name(args[0]+1), p, args[1], -1);
 	}
 	else {
+		botnet_entity_t src = user_entity(p);
+
 		partymember_t *dest = partymember_lookup(args[0], NULL, -1);
 		if (!dest) egg_iprintf(idx, ":eggdrop.bot 401 %s %s :No such nick/channel\r\n", p->nick, args[0]);
-		else partymember_msg(dest, p, args[1], -1);
+		else partymember_msg(dest, &src, args[1], -1);
 	}
 	return(0);
 }
Index: eggdrop1.9/modules/oldbotnet/events.c
diff -u eggdrop1.9/modules/oldbotnet/events.c:1.8 eggdrop1.9/modules/oldbotnet/events.c:1.9
--- eggdrop1.9/modules/oldbotnet/events.c:1.8	Tue Nov 14 08:51:24 2006
+++ eggdrop1.9/modules/oldbotnet/events.c	Sat Apr 14 10:21:13 2007
@@ -18,102 +18,174 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: events.c,v 1.8 2006-11-14 14:51:24 sven Exp $";
+static const char rcsid[] = "$Id: events.c,v 1.9 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
 
 #include "oldbotnet.h"
 
-static int on_pub(const char *name, int cid, partymember_t *src, const char *text, int len);
-static int on_join(const char *name, int cid, partymember_t *src);
-static int on_part(const char *name, int cid, partymember_t *src, const char *text, int len);
-
-int oldbotnet_events_init()
-{
-//	bind_add_simple(BTN_PARTYLINE_PUBLIC, NULL, NULL, on_pub);
-//	bind_add_simple(BTN_PARTYLINE_JOIN, NULL, NULL, on_join);
-//	bind_add_simple(BTN_PARTYLINE_PART, NULL, NULL, on_part);
-	return(0);
-}
-
-/* Taken from botmsg.c in eggdrop 1.6. */
-static char tobase64array[64] = {
-	'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
-	'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
-	'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
-	'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
-	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
-	'[', ']'
+/* botnet callbacks */
+static int on_bcast(void *client_data, botnet_entity_t *src, const char *text, int len);
+static int on_quit(void *client_data, partymember_t *src, const char *text, int len);
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len);
+static int on_join(void *client_data, partychan_t *chan, partymember_t *src, int linking);
+static int on_new_bot(void *client_data, botnet_bot_t *bot, int linking);
+static int on_lost_bot(void *client_data, botnet_bot_t *bot, const char *reason);
+static int on_unlink(void *client_data, botnet_entity_t *from, botnet_bot_t *bot, const char *reason);
+static int on_botmsg(void *client_data, botnet_bot_t *src, botnet_bot_t *dst, const char *command, const char *text, int len);
+static int on_botbroadcast(void *client_data, botnet_bot_t *src, const char *command, const char *text, int len);
+
+botnet_handler_t bothandler = {
+	on_bcast, NULL, on_quit,
+	on_chanmsg, on_join, NULL,
+	on_new_bot, on_lost_bot, on_unlink, on_botmsg, on_botbroadcast, NULL
 };
 
-/* Modified from int_to_base64() in botmsg.c in eggdrop 1.6. */
-static char *ito64(int val)
+static int tobase64[] = {
+	'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
+	'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
+	'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+	'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '[', ']'
+};
+
+/*!
+ * \brief Calculate the base64 value of an int.
+ *
+ * Uses the eggdrop1.6 style base64 algotithm to convert an int to a
+ * base64 string.
+ *
+ * \param i The number to convert.
+ *
+ * \return A string containing the base64 value of \e i.
+ *
+ * \warning This function returns a pointer to a static buffer. Calling it
+ *          again will overwrite it. \b Always \b remember!
+ */
+
+static const char *itob(int i)
 {
-	static char s[16];
-	char *ptr = s;
+	char *pos;
+	static char ret[12];
+
+	pos = ret + 11;
+	*pos = 0;
 
 	do {
-		*ptr++ = tobase64array[val & 0x3f];
-		val = val >> 6;
-	} while (val);
-	*ptr = 0;
-	return(s);
+		--pos;
+		*pos = tobase64[i & 0x3F];
+		i >>= 6;
+	} while (i);
+
+	return pos;
+}
+
+/*!
+ * \brief Send a broadcast event out.
+ *
+ * Send a broadcast (ct) out. eggdrop1.6 expects broadcasts to originate from
+ * a bot. If the source is a person, change it to the bot the person is on.
+ *
+ * \param client_data The ::oldbotnet_t struct of the bot.
+ * \param src The source of the broadcast.
+ * \param text The string to broadcast.
+ * \param len The string length.
+ *
+ * \return Always 0.
+ */
+
+static int on_bcast(void *client_data, botnet_entity_t *src, const char *text, int len)
+{
+	const char *name;
+	oldbotnet_t *obot = client_data;
+
+	if (src->what == ENTITY_BOT) name = src->full_name;
+	else if (src->user->bot) name = src->user->bot->name;
+	else name = botnet_get_name();
+
+	egg_iprintf(obot->idx, "ct %s %s\n", name, text);
+
+	return 0;
 }
 
-static char *sto64(const char *s)
+static int on_quit(void *client_data, partymember_t *src, const char *text, int len)
 {
-	int val = atoi(s);
-	return ito64(val);
+	oldbotnet_t *obot = client_data;
+
+	egg_iprintf(obot->idx, "pt %s %s %s\n", src->bot ? src->bot->name : botnet_get_name(), src->nick, itob(src->id));
+
+	return 0;
 }
 
-static int validchan(const char *chan)
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len)
 {
-	while (*chan) if (!isdigit(*chan++)) return(0);
-	return(1);
+	oldbotnet_t *obot = client_data;
+
+	if (len >= 9 && !strncasecmp(text, "\1ACTION ", 8) && text[len - 1] == 1) {
+		egg_iprintf(obot->idx, "a %s %s %.*s\n", src->full_name, itob(assoc_get_id(chan->name)), len - 9, text + 8);
+	} else {
+		egg_iprintf(obot->idx, "c %s %s %s\n", src->full_name, itob(assoc_get_id(chan->name)), text);
+	}
+	return 0;
 }
 
-#if 0
-static int on_privmsg(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len)
+static int on_join(void *client_data, partychan_t *chan, partymember_t *src, int linking)
 {
-	return(0);
+	char *cid;
+	oldbotnet_t *obot = client_data;
+
+	cid = strdup(itob(assoc_get_id(chan->name)));
+	egg_iprintf(obot->idx, "j %s%s %s %s %c%s %s@%s\n", linking ? "!" : "", src->bot ? src->bot->name : botnet_get_name(), src->nick, cid, '*', itob(src->id), src->ident, src->host);
+
+	return 0;
 }
 
-static int on_nick(void *client_data, partymember_t *src, const char *oldnick, const char *newnick)
+static int on_new_bot(void *client_data, botnet_bot_t *bot, int linking)
 {
-	return(0);
+	oldbotnet_t *obot = client_data;
+
+	egg_iprintf(obot->idx, "n %s %s %cEDNI\n", bot->name, bot->uplink ? bot->uplink->name : botnet_get_name(), linking ? '-' : '!');
+
+	return 0;
 }
 
-static int on_quit(void *client_data, partymember_t *src, const char *text, int len)
+static int on_lost_bot(void *client_data, botnet_bot_t *bot, const char *reason)
 {
-	return(0);
+	oldbotnet_t *obot = client_data;
+
+	if (bot == obot->bot) egg_iprintf(obot->idx, "bye %s", reason);
+	else egg_iprintf(obot->idx, "un %s %s\n", bot->name, reason);
+
+	return 0;
 }
-#endif
 
-static int on_pub(const char *name, int cid, partymember_t *src, const char *text, int len)
+static int on_unlink(void *client_data, botnet_entity_t *from, struct botnet_bot *bot, const char *reason)
 {
-/*	if (!oldbotnet.connected || !validchan(name)) return(0);
+	oldbotnet_t *obot = client_data;
+
+	egg_iprintf(obot->idx, "ul %s %s %s %s\n", from->full_name, bot->uplink->name, bot->name, reason);
 
-	if (!src) egg_iprintf(oldbotnet.idx, "c %s %s %s\n", oldbotnet.name, sto64(name), text);
-	else if (src->pid < BOT_PID_MULT) egg_iprintf(oldbotnet.idx, "c %s@%s %s %s\n", src->nick, oldbotnet.name, sto64(name), text);
-*/
-	return(0);
+	return 0;
 }
 
-static int on_join(const char *name, int cid, partymember_t *src)
+static int on_botbroadcast(void *client_data, botnet_bot_t *src, const char *command, const char *text, int len)
 {
-/*	if (!oldbotnet.connected || !validchan(name) || src->pid >= BOT_PID_MULT) return(0);
+	const char *srcname = src ? src->name : botnet_get_name();
+	oldbotnet_t *obot = client_data;
 
-	egg_iprintf(oldbotnet.idx, "j %s %s %s *%s %s@%s\n", oldbotnet.name, src->nick, sto64(name), ito64(src->pid), src->ident, src->host);
-*/
-	return(0);
+	if (text && len > 0) egg_iprintf(obot->idx, "z %s %s %s", srcname, command, text);
+	else egg_iprintf(obot->idx, "z %s %s", srcname, command);
+
+	return 0;
 }
 
-static int on_part(const char *name, int cid, partymember_t *src, const char *text, int len)
+static int on_botmsg(void *client_data, botnet_bot_t *src, botnet_bot_t *dst, const char *command, const char *text, int len)
 {
-/*	if (!oldbotnet.connected || !validchan(name) || src->pid >= BOT_PID_MULT) return(0);
+	const char *srcname = src ? src->name : botnet_get_name();
+	oldbotnet_t *obot = client_data;
+
+	if (text && len > 0) egg_iprintf(obot->idx, "zb %s %s %s %s", srcname, dst->name, command, text);
+	else egg_iprintf(obot->idx, "zb %s %s %s", srcname, dst->name, command);
 
-	egg_iprintf(oldbotnet.idx, "pt %s %s %s %s\n", oldbotnet.name, src->nick, ito64(src->pid), text ? text : "");
-*/
-	return(0);
+	return 0;
 }
Index: eggdrop1.9/modules/oldbotnet/oldbotnet.c
diff -u eggdrop1.9/modules/oldbotnet/oldbotnet.c:1.15 eggdrop1.9/modules/oldbotnet/oldbotnet.c:1.16
--- eggdrop1.9/modules/oldbotnet/oldbotnet.c:1.15	Sat Jan 13 06:23:40 2007
+++ eggdrop1.9/modules/oldbotnet/oldbotnet.c	Sat Apr 14 10:21:13 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: oldbotnet.c,v 1.15 2007-01-13 12:23:40 sven Exp $";
+static const char rcsid[] = "$Id: oldbotnet.c,v 1.16 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -36,16 +36,21 @@
 static int party_minus_obot(partymember_t *p, char *nick, user_t *u, char *cmd, char *text);
 
 /* Oldbotnet commands. */
+static int got_actchan(botnet_bot_t *bot, const char *cmd, const char *next);
+static int got_bcast(botnet_bot_t *bot, const char *cmd, const char *next);
 static int got_handshake(botnet_bot_t *bot, const char *cmd, const char *next);
-static int got_ping(botnet_bot_t *bot, char *cmd, char *next);
+static int got_ping(botnet_bot_t *bot, const char *cmd, char *next);
+static int got_idle(botnet_bot_t *bot, const char *cmd, const char *next);
 static int got_join(botnet_bot_t *bot, const char *cmd, const char *next);
 static int got_part(botnet_bot_t *bot, const char *cmd, const char *next);
-static int got_chat(botnet_bot_t *bot, char *cmd, const char *next);
+static int got_chat(botnet_bot_t *bot, const char *cmd, const char *next);
 static int got_nlinked(botnet_bot_t *bot, const char *cmd, const char *next);
 static int got_unlinked(botnet_bot_t *bot, const char *cmd, const char *next);
 static int got_bye(botnet_bot_t *bot, const char *cmd, const char *text);
 static int got_endlink(botnet_bot_t *bot, const char *cmd, const char *next);
 static int got_thisbot(botnet_bot_t *bot, const char *cmd, const char *next);
+static int got_botmsg(botnet_bot_t *bot, const char *cmd, const char *next);
+static int got_botbroadcast(botnet_bot_t *bot, const char *cmd, const char *next);
 
 /* Sockbuf handler. */
 static int oldbotnet_on_connect(void *client_data, int idx, const char *peer_ip, int peer_port);
@@ -53,14 +58,6 @@
 static int oldbotnet_on_eof(void *client_data, int idx, int err, const char *errmsg);
 static int oldbotnet_on_delete(void *client_data, int idx);
 
-/* botnet callbacks */
-static int on_quit(void *client_data, partymember_t *src, const char *text, int len);
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
-static int on_join(void *client_data, partychan_t *chan, partymember_t *src, int linking);
-static int on_new_bot(void *client_data, botnet_bot_t *bot, int linking);
-static int on_lost_bot(void *client_data, botnet_bot_t *bot, const char *reason);
-static int on_unlink(void *client_data, partymember_t *from, botnet_bot_t *bot, const char *reason);
-
 static event_owner_t bot_owner = {
 	"oldbotnet", NULL,
 	NULL, NULL,
@@ -79,49 +76,57 @@
 	sock_on_delete
 };*/
 
-static botnet_handler_t handler = {
-	NULL, on_quit,
-	on_chanmsg, on_join, NULL,
-	on_new_bot, on_lost_bot, on_unlink, NULL
-};
-
 typedef struct assoc {
 	char *name;
 	int id;
+	int dynamic;
+	time_t last_bounced;
 	struct assoc *next;
 } assoc_t;
 
-assoc_t assocs = {
+static assoc_t assocs = {
 	"*",
 	0,
+	0,
+	0,
 	NULL
 };
 
 static bind_list_t party_binds[] = {
-	{"n", "+obot", party_plus_obot},	/* DDD	*/
-	{"n", "-obot", party_minus_obot},	/* DDD	*/
+	{"n", "+obot", party_plus_obot},
+	{"n", "-obot", party_minus_obot},
 	{0}
 };
 
 static bind_list_t obot_binds[] = {
-	{NULL, "handshake", got_handshake},   /* DDD */
-	{NULL, "h", got_handshake},           /* DDD */
-	{NULL, "ping", got_ping},             /* DDD */
-	{NULL, "pi", got_ping},               /* DDD */
-	{NULL, "join", got_join},             /* DDD */
-	{NULL, "j", got_join},                /* DDD */
-	{NULL, "chat", got_chat},             /* DDD */
-	{NULL, "c", got_chat},                /* DDD */
-	{NULL, "n", got_nlinked},             /* DDD */
-	{NULL, "nlinked", got_nlinked},       /* DDD */
-	{NULL, "el", got_endlink},
-	{NULL, "un", got_unlinked},
-	{NULL, "unlinked", got_unlinked},
+	{NULL, "a", got_actchan},
+	{NULL, "actchan", got_actchan},
 	{NULL, "bye", got_bye},
+	{NULL, "c", got_chat},
+	{NULL, "chan", got_chat},
+	{NULL, "ct", got_bcast}, 
+	{NULL, "chat", got_bcast},
+	{NULL, "el", got_endlink},
+	{NULL, "h", got_handshake},
+	{NULL, "handshake", got_handshake},
+	{NULL, "i", got_idle},
+	{NULL, "idle", got_idle},
+	{NULL, "j", got_join},
+	{NULL, "join", got_join},
+	{NULL, "n", got_nlinked},
+	{NULL, "nlinked", got_nlinked},
+	{NULL, "pi", got_ping},
+	{NULL, "ping", got_ping},
+	{NULL, "pt", got_part},
+	{NULL, "part", got_part},
 	{NULL, "tb", got_thisbot},
 	{NULL, "thisbot", got_thisbot},
-	{NULL, "part", got_part},
-	{NULL, "pt", got_part},
+	{NULL, "un", got_unlinked},
+	{NULL, "unlinked", got_unlinked},
+	{NULL, "z", got_botmsg},
+	{NULL, "zapf", got_botmsg},
+	{NULL, "zb", got_botbroadcast},
+	{NULL, "zapf-broad", got_botbroadcast},
 	{0}
 };
 
@@ -139,57 +144,64 @@
 
 static bind_table_t *BT_obot = NULL;
 
-int assoc_get_id(const char *name)
+const char *assoc_get_name(int id)
 {
-	int highest_id = 0;
+	int try = 0;
 	assoc_t *a;
 
 	for (a = &assocs; a; a = a->next) {
-		if (!strcmp(a->name, name)) break;
-		if (a->id > highest_id) highest_id = a->id;
+		if (a->id == id) break;
 	}
-	if (a) return a->id;
+	if (a) return a->name;
+
 	a = malloc(sizeof(*a));
-	a->name = strdup(name);
-	a->id = highest_id + 1;
+	do {
+		if (!try) {
+			a->name = egg_mprintf("%d", id);
+		} else {
+			free(a->name);
+			a->name = egg_mprintf("%d_%d", id, try + 1);
+		}
+		++try;
+	} while (partychan_lookup_name(a->name));
+	a->id = id;
 	a->next = assocs.next;
+	a->dynamic = 1;
+	a->last_bounced = 0;
 	assocs.next = a;
-	return a->id;
+	return a->name;
 }
 
-const char *assoc_get_name(int id)
+int assoc_get_id(const char *name)
 {
+	int highest_id = 0;
 	assoc_t *a;
 
 	for (a = &assocs; a; a = a->next) {
-		if (a->id == id) break;
+		if (!strcmp(a->name, name)) break;
+		if (a->id > highest_id) highest_id = a->id;
 	}
-	if (a) return a->name;
+	if (a) return a->id;
+
 	a = malloc(sizeof(*a));
-	a->name = egg_mprintf("%d", id);
-	a->id = id;
+	a->name = strdup(name);
+	a->id = highest_id + 1;
+	a->last_bounced = 0;
+	a->dynamic = 0;
 	a->next = assocs.next;
 	assocs.next = a;
-	return a->name;
+	return a->id;
 }
 
-int oldbotnet_init()
+static int oldbotnet_init()
 {
 	BT_obot = bind_table_add("obot", 3, "Bss", MATCH_MASK, BIND_STACKABLE);	/* DDD */
 	bind_add_list("obot", obot_binds);
 	bind_add_list("party", party_binds);
-	oldbotnet_events_init();
 	bind_add_simple(BTN_BOTNET_REQUEST_LINK, NULL, "old-eggdrop", do_link);
 	return(0);
 }
 
-static int tobase64[] = {
-	'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
-	'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
-	'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
-	'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '[', ']'
-};
-
 static char base64to[256] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -214,37 +226,6 @@
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-/*!
- * \brief Calculate the base64 value of an int.
- *
- * Uses the eggdrop1.6 style base64 algotithm to convert an int to a
- * base64 string.
- *
- * \param i The number to convert.
- *
- * \return A string containing the base64 value of \e i.
- *
- * \warning This function returns a pointer to a static buffer. Calling it
- *          again will overwrite it. \b Always \b remember!
- */
-
-static const char *itob(int i)
-{
-	char *pos;
-	static char ret[12];
-
-	pos = ret + 11;
-	*pos = 0;
-
-	do {
-		--pos;
-		*pos = tobase64[i & 0x3F];
-		i >>= 6;
-	} while (i);
-
-	return pos;
-}
-
 static int btoi(const char *b)
 {
 	int i = 0;
@@ -253,64 +234,6 @@
 	return(i);
 }
 
-static int on_quit(void *client_data, partymember_t *src, const char *text, int len)
-{
-	oldbotnet_t *obot = client_data;
-
-	egg_iprintf(obot->idx, "pt %s %s %s\n", src->bot ? src->bot->name : botnet_get_name(), src->nick, itob(src->id));
-
-	return 0;
-}
-
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len)
-{
-	oldbotnet_t *obot = client_data;
-
-	egg_iprintf(obot->idx, "c %s %s %s\n", src->full_name, itob(assoc_get_id(chan->name)), text);
-
-	return 0;
-}
-
-static int on_join(void *client_data, partychan_t *chan, partymember_t *src, int linking)
-{
-	char *cid;
-	oldbotnet_t *obot = client_data;
-
-	cid = strdup(itob(assoc_get_id(chan->name)));
-	egg_iprintf(obot->idx, "j %s%s %s %s %c%s %s@%s\n", linking ? "!" : "", src->bot ? src->bot->name : botnet_get_name(), src->nick, cid, '*', itob(src->id), src->ident, src->host);
-
-	return 0;
-}
-
-static int on_new_bot(void *client_data, botnet_bot_t *bot, int linking)
-{
-	oldbotnet_t *obot = client_data;
-
-	egg_iprintf(obot->idx, "n %s %s %cEDNI\n", bot->name, bot->uplink ? bot->uplink->name : botnet_get_name(), linking ? '-' : '!');
-
-	return 0;
-}
-
-static int on_lost_bot(void *client_data, botnet_bot_t *bot, const char *reason)
-{
-	oldbotnet_t *obot = client_data;
-
-	if (bot == obot->bot) egg_iprintf(obot->idx, "bye %s", reason);
-	else egg_iprintf(obot->idx, "un %s %s\n", bot->name, reason);
-
-	return 0;
-}
-
-static int on_unlink(void *client_data, partymember_t *from, struct botnet_bot *bot, const char *reason)
-{
-	oldbotnet_t *obot = client_data;
-
-	if (from->nick) egg_iprintf(obot->idx, "ul %s %s %s %s\n", from->full_name, bot->uplink->name, bot->name, reason);
-	else egg_iprintf(obot->idx, "ul %s %s %s %s\n", from->bot ? from->bot->name : botnet_get_name(), bot->uplink->name, bot->name, reason); 
-
-	return 0;
-}
-
 /* +obot <obot> <host> <port> [username] [password] */
 static int party_plus_obot(partymember_t *p, char *nick, user_t *u, char *cmd, char *text)
 {
@@ -418,6 +341,17 @@
 	return BIND_RET_BREAK;
 }
 
+/*!
+ * \brief Send a password for login.
+ *
+ * The other bot has sent us a pseudorandom string. We append the plaintext
+ * password to this string and encode the whole thing with MD5. This way the
+ * actual password isn't send over the internet.
+ *
+ * \param bot We're not yet linked, so this is the ::oldbotnet_t struct.
+ * \param next The challenge string the other bot has sent.
+ */
+
 static void got_passreq(oldbotnet_t *bot, const char *next)
 {
 	if (!bot->password) {
@@ -428,7 +362,8 @@
 
 	if (next && *next == '<') {
 		MD5_CTX md5;
-		char hash[16], hex[64];
+		unsigned char hash[16];
+		char hex[64];
 		int i;
 
 		MD5_Init(&md5);
@@ -449,6 +384,8 @@
  *
  * "handshake" means the linked bot set a new link password. Just save it.
  *
+ * \format \b handshake new_password
+ *
  * \param bot The bot the text came from.
  * \param cmd The first word it sent, the command. Always "h" or "handshake".
  * \param text Just one word: the new password in plain text.
@@ -462,6 +399,22 @@
 	return BIND_RET_BREAK;
 }
 
+/*!
+ * \brief Handle the version command.
+ *
+ * This function handles the version command. Once the other bot has sent it
+ * the linking process is completed. We will send our version command after
+ * we've seen the other bot's version so we'll know what handle length to send.
+ * After that send our botnet and endlink.
+ *
+ * \format version numeric_version hand_len some version string \<network\>
+ *
+ * \param bot The bot it came from.
+ * \param next The version text.
+ *
+ * \todo Send the actual version and network out here.
+ */
+
 static void got_version(oldbotnet_t *bot, const char *next)
 {
 	/* Get their version and handlen. */
@@ -474,12 +427,67 @@
 	/* And now we're connected. */
 	bot->connected = 1;
 	bot->linking = 1;
-	bot->bot = botnet_new(bot->user->handle, bot->user, NULL, NULL, &handler, bot, &bot_owner, 0);
+	bot->bot = botnet_new(bot->user->handle, bot->user, NULL, NULL, &bothandler, bot, &bot_owner, 0);
 	botnet_replay_net(bot->bot);
 	egg_iprintf(bot->idx, "el\n");
 }
 
-static int got_ping(botnet_bot_t *bot, char *cmd, char *next)
+static int got_actchan(botnet_bot_t *bot, const char *cmd, const char *next)
+{
+	char *word[2], buf[1024], *action;
+	partymember_t *p;
+	int n, len;
+
+	n = egg_get_word_array(next, &next, word, 2);
+	if (n != 2 || !next) {
+		egg_free_word_array(word, 2);
+		return BIND_RET_BREAK;
+	}
+
+	p = partymember_lookup(word[0], NULL, -1);
+	if (!p || botnet_check_direction(bot, p->bot)) {
+		egg_free_word_array(word, 2);
+		return BIND_RET_BREAK;
+	}
+	botnet_entity_t src = user_entity(p);
+
+	while (isspace(*next)) next++;
+	action = egg_msprintf(buf, sizeof(buf), &len, "\1ACTION %s\1", next);
+	partychan_msg_name(assoc_get_name(btoi(word[1])), &src, action, len);  
+	if (action != buf) free(action);
+
+	egg_free_word_array(word, 2);
+	return BIND_RET_BREAK;
+}
+
+static int got_bcast(botnet_bot_t *bot, const char *cmd, const char *text)
+{
+	char *srcname;
+	botnet_bot_t *srcbot;
+
+	if (egg_get_word(text, &text, &srcname)) return BIND_RET_BREAK;
+
+	srcbot = botnet_lookup(srcname);
+	free(srcname);
+	if (!botnet_check_direction(bot, srcbot)) return BIND_RET_BREAK;
+
+	botnet_entity_t src = bot_entity(srcbot);
+	botnet_broadcast(&src, text, -1);
+
+	return BIND_RET_BREAK;
+}
+
+/*!
+ * \brief Handle a ping.
+ *
+ * It's a ping. Send a pong.
+ *
+ * \param bot The bot the ping came from.
+ * \param cmd "ping" or "pi".
+ * \param next Nothing.
+ */
+
+static int got_ping(botnet_bot_t *bot, const char *cmd, char *next)
 {
 	oldbotnet_t *obot = bot->client_data;
 
@@ -557,6 +565,7 @@
 	if (egg_get_word(text, &text, &lostname)) return BIND_RET_BREAK;
 
 	lost = botnet_lookup(lostname);
+	free(lostname);
 	if (botnet_check_direction(bot, lost)) return BIND_RET_BREAK;
 
 	while (isspace(*text)) ++text;
@@ -564,6 +573,13 @@
 	return BIND_RET_BREAK;
 }
 
+static int got_idle(botnet_bot_t *bot, const char *cmd, const char *next)
+{
+	/*! We don't care.
+	 *  \todo Care! */
+	 return BIND_RET_BREAK;
+}
+
 static int got_join(botnet_bot_t *bot, const char *cmd, const char *next)
 {
 	char *word[5];
@@ -651,11 +667,11 @@
 	return BIND_RET_BREAK;
 }
 
-static int got_chat(botnet_bot_t *bot, char *cmd, const char *next)
+static int got_chat(botnet_bot_t *bot, const char *cmd, const char *next)
 {
 	char *word[2];
-	partymember_t *p;
 	int n;
+	botnet_entity_t src;
 
 	n = egg_get_word_array(next, &next, word, 2);
 	if (n != 2 || !next) {
@@ -663,15 +679,113 @@
 		return BIND_RET_BREAK;
 	}
 
-	p = partymember_lookup(word[0], NULL, -1);
-	if (!p || botnet_check_direction(bot, p->bot)) {
+	if (strchr(word[0], '@')) {
+		partymember_t *p = partymember_lookup(word[0], NULL, -1);
+		if (!p || botnet_check_direction(bot, p->bot)) {
+			egg_free_word_array(word, 2);
+			return BIND_RET_BREAK;
+		}
+		set_user_entity(&src, p);
+	} else {
+		botnet_bot_t *b = botnet_lookup(word[0]);
+		if (!b || !botnet_check_direction(bot, b)) {
+			egg_free_word_array(word, 2);
+			return BIND_RET_BREAK;
+		}
+		set_bot_entity(&src, b);
+	}
+
+	while (isspace(*next)) next++;
+	partychan_msg_name(assoc_get_name(btoi(word[1])), &src, next, strlen(next));
+
+	egg_free_word_array(word, 2);
+	return BIND_RET_BREAK;
+}
+
+static void got_assoc(botnet_bot_t *src, const char *text)
+{
+	
+}
+
+/*!
+ * \brief Handle a message from a bot for a bot.
+ *
+ * This is the old "zapf" message, whatever that may mean. It's called botmsg
+ * in this version. It's some text from a script on a bot for another script
+ * on another bot. If there's no script listening for the message on the
+ * destination bot it'll be ignored.
+ *
+ * \param bot The bot the msg came from.
+ * \param cmd "zapf" or "z".
+ * \param next The parameters.
+ *
+ * \format \b zapf from_bot to_bot command [parameters]
+ */
+
+static int got_botmsg(botnet_bot_t *bot, const char *cmd, const char *next)
+{
+	int n;
+	char *word[3];
+	botnet_bot_t *src, *dst;
+
+	n = egg_get_word_array(next, &next, word, 3);
+	if (n != 3) {
+		egg_free_word_array(word, 3);
+		return BIND_RET_BREAK;
+	}
+
+	src = botnet_lookup(word[0]);
+	if (!src || botnet_check_direction(bot, src)) {
+		egg_free_word_array(word, 3);
+		return BIND_RET_BREAK;
+	}
+
+	dst = botnet_lookup(word[1]);
+	if (!dst && strcmp(word[1], botnet_get_name())) {
+		egg_free_word_array(word, 3);
+		return BIND_RET_BREAK;
+	}
+
+	if (!dst && !strcmp(word[2], "assoc") && next && *next) got_assoc(src, next);
+	botnet_botmsg(src, dst, word[2], next, -1);
+	egg_free_word_array(word, 3);
+	return BIND_RET_BREAK;
+}
+
+/*!
+ * \brief Handle a message from a bot to the entire net.
+ *
+ * This is the old "zapf-broad" message, whatever that may mean. It's called
+ * botbroadcast in this version. It's some text from a script on a bot for
+ * another script all other bots. If there's no script listening for the
+ * message on any given bot it'll be ignored (but still passed on).
+ *
+ * \param bot The bot the msg came from.
+ * \param cmd "zapf" or "z".
+ * \param next The parameters.
+ *
+ * \format \b zapf from_bot command [parameters]
+ */
+
+static int got_botbroadcast(botnet_bot_t *bot, const char *cmd, const char *next)
+{
+	int n;
+	char *word[2];
+	botnet_bot_t *src;
+
+	n = egg_get_word_array(next, &next, word, 2);
+	if (n != 2) {
 		egg_free_word_array(word, 2);
 		return BIND_RET_BREAK;
 	}
 
-	while (isspace(*next)) next++;
-	partychan_msg_name(assoc_get_name(btoi(word[1])), p, next, strlen(next));
+	src = botnet_lookup(word[0]);
+	if (botnet_check_direction(bot, src)) {
+		egg_free_word_array(word, 2);
+		return BIND_RET_BREAK;
+	}
 
+	botnet_botbroadcast(src, word[1], next, -1);
 	egg_free_word_array(word, 2);
 	return BIND_RET_BREAK;
 }
@@ -760,6 +874,14 @@
 
 static int oldbotnet_close(int why)
 {
+	assoc_t *a, *next;
+
+	for (a = assocs.next; a; a = next) {
+		next = a->next;
+		free(a->name);
+		free(a);
+	} 
+	assocs.next = NULL;
 	return(0);
 }
 
@@ -769,9 +891,10 @@
 	modinfo->name = "oldbotnet";
 	modinfo->author = "eggdev";
 	modinfo->version = "1.0.0";
-	modinfo->description = "oldbotnet chat support for the partyline";
+	modinfo->description = "oldbotnet support for most things excluding shares";
 	modinfo->close_func = oldbotnet_close;
-
+	
 	oldbotnet_init();
+
 	return(0);
 }
Index: eggdrop1.9/modules/oldbotnet/oldbotnet.h
diff -u eggdrop1.9/modules/oldbotnet/oldbotnet.h:1.4 eggdrop1.9/modules/oldbotnet/oldbotnet.h:1.5
--- eggdrop1.9/modules/oldbotnet/oldbotnet.h:1.4	Tue Nov 14 08:51:24 2006
+++ eggdrop1.9/modules/oldbotnet/oldbotnet.h	Sat Apr 14 10:21:13 2007
@@ -16,13 +16,14 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: oldbotnet.h,v 1.4 2006-11-14 14:51:24 sven Exp $
+ * $Id: oldbotnet.h,v 1.5 2007-04-14 15:21:13 sven Exp $
  */
 
 #ifndef _EGG_MOD_OLDBOTNET_OLDBOTNET_H_
 #define _EGG_MOD_OLDBOTNET_OLDBOTNET_H_
 
-#define BOT_PID_MULT	1000
+#define bothandler   oldbotnet_LTX_bothandler
+#define assoc_get_id oldbotnet_LTX_assoc_get_id
 
 typedef struct {
 	char *host;
@@ -47,6 +48,7 @@
 } oldbotnet_t;
 
 /* From events.c */
-extern int oldbotnet_events_init();
+botnet_handler_t bothandler;
+int assoc_get_id(const char *name);
 
 #endif /* !_EGG_MOD_OLDBOTNET_OLDBOTNET_H_ */
Index: eggdrop1.9/modules/perlscript/perlscript.c
diff -u eggdrop1.9/modules/perlscript/perlscript.c:1.32 eggdrop1.9/modules/perlscript/perlscript.c:1.33
--- eggdrop1.9/modules/perlscript/perlscript.c:1.32	Tue Nov 14 08:51:24 2006
+++ eggdrop1.9/modules/perlscript/perlscript.c	Sat Apr 14 10:21:13 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: perlscript.c,v 1.32 2006-11-14 14:51:24 sven Exp $";
+static const char rcsid[] = "$Id: perlscript.c,v 1.33 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #ifdef DEBUG
@@ -38,7 +38,7 @@
 static XS(my_command_handler);
 static SV *c_to_perl_var(script_var_t *v);
 static int perl_to_c_var(SV *sv, script_var_t *var, int type);
-static int my_perl_cb_delete(event_owner_t *owner, script_callback_t *me);
+static int my_perl_cb_delete(event_owner_t *owner, void *me);
 
 static int my_load_script(void *ignore, char *fname);
 static int my_link_var(void *ignore, script_linked_var_t *linked_var);
@@ -260,8 +260,10 @@
 	return(retval);
 }
 
-static int my_perl_cb_delete(event_owner_t *owner, script_callback_t *me)
+static int my_perl_cb_delete(event_owner_t *owner, void *data)
 {
+	script_callback_t *me = data;
+
 	if (me->syntax) free(me->syntax);
 	if (me->name) free(me->name);
 	sv_2mortal((SV *)me->callback_data);
Index: eggdrop1.9/modules/script/scripttimer.c
diff -u eggdrop1.9/modules/script/scripttimer.c:1.12 eggdrop1.9/modules/script/scripttimer.c:1.13
--- eggdrop1.9/modules/script/scripttimer.c:1.12	Wed Dec 28 11:27:31 2005
+++ eggdrop1.9/modules/script/scripttimer.c	Sat Apr 14 10:21:13 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: scripttimer.c,v 1.12 2005-12-28 17:27:31 sven Exp $";
+static const char rcsid[] = "$Id: scripttimer.c,v 1.13 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -84,7 +84,7 @@
 
 static int script_timer_info(script_var_t *retval, int timer_id)
 {
-	egg_timeval_t howlong, trigger_time, start_time, diff, now;
+	egg_timeval_t start_time, diff, now;
 	egg_timer_t *timer;
 
 	retval->type = SCRIPT_VAR | SCRIPT_FREE | SCRIPT_ARRAY;
@@ -105,8 +105,8 @@
 	script_list_append(retval, script_int(start_time.sec));
 	script_list_append(retval, script_int(start_time.usec));
 
-	script_list_append(retval, script_int(howlong.sec));
-	script_list_append(retval, script_int(howlong.usec));
+	script_list_append(retval, script_int(timer->howlong.sec));
+	script_list_append(retval, script_int(timer->howlong.usec));
 
 	timer_diff(&start_time, &now, &diff);
 	script_list_append(retval, script_int(diff.sec));
@@ -116,8 +116,8 @@
 	script_list_append(retval, script_int(diff.sec));
 	script_list_append(retval, script_int(diff.usec));
 
-	script_list_append(retval, script_int(trigger_time.sec));
-	script_list_append(retval, script_int(trigger_time.usec));
+	script_list_append(retval, script_int(timer->trigger_time.sec));
+	script_list_append(retval, script_int(timer->trigger_time.usec));
 
 	return(0);
 }
Index: eggdrop1.9/modules/tclscript/tclscript.c
diff -u eggdrop1.9/modules/tclscript/tclscript.c:1.51 eggdrop1.9/modules/tclscript/tclscript.c:1.52
--- eggdrop1.9/modules/tclscript/tclscript.c:1.51	Tue Nov 14 08:51:24 2006
+++ eggdrop1.9/modules/tclscript/tclscript.c	Sat Apr 14 10:21:13 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: tclscript.c,v 1.51 2006-11-14 14:51:24 sven Exp $";
+static const char rcsid[] = "$Id: tclscript.c,v 1.52 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #include <string.h>
@@ -48,7 +48,7 @@
 static int my_command_handler(ClientData client_data, Tcl_Interp *myinterp, int objc, Tcl_Obj *CONST objv[]);
 static Tcl_Obj *c_to_tcl_var(Tcl_Interp *myinterp, script_var_t *v);
 static int tcl_to_c_var(Tcl_Interp *myinterp, Tcl_Obj *obj, script_var_t *var, int type);
-static int my_tcl_cb_delete(event_owner_t *owner, script_callback_t *me);
+static int my_tcl_cb_delete(event_owner_t *owner, void *me);
 
 /* Implementation of the script module interface. */
 static int my_load_script(void *ignore, char *fname);
@@ -288,11 +288,12 @@
 }
 
 /* This implements the delete() member of Tcl script callbacks. */
-static int my_tcl_cb_delete(event_owner_t *owner, script_callback_t *me)
+static int my_tcl_cb_delete(event_owner_t *owner, void *data)
 {
+	script_callback_t *me = data;
 	my_callback_cd_t *cd;
 
-	cd = (my_callback_cd_t *)me->callback_data;
+	cd = me->callback_data;
 	Tcl_DecrRefCount(cd->command);
 	if (cd->name) free(cd->name);
 	if (me->syntax) free(me->syntax);
@@ -390,7 +391,7 @@
 			if (!str) str = "";
 			if (v->len == -1) v->len = strlen(str);
 #ifdef USE_TCL_BYTE_ARRAYS
-			result = Tcl_NewByteArrayObj(str, v->len);
+			result = Tcl_NewByteArrayObj((unsigned char *) str, v->len);
 #else
 			result = Tcl_NewStringObj(str, v->len);
 #endif
@@ -404,7 +405,7 @@
 			result = Tcl_NewListObj(0, NULL);
 			while (str && *str) {
 #ifdef USE_TCL_BYTE_ARRAYS
-				element = Tcl_NewByteArrayObj(*str, strlen(*str));
+				element = Tcl_NewByteArrayObj((unsigned char *) (*str), strlen(*str));
 #else
 				element = Tcl_NewStringObj(*str, strlen(*str));
 #endif
@@ -473,10 +474,10 @@
 			int len;
 
 #ifdef USE_TCL_BYTE_ARRAYS
-				char *bytes;
+				unsigned char *bytes;
 
 				bytes = Tcl_GetByteArrayFromObj(obj, &len);
-				str = (char *)malloc(len+1);
+				str = malloc(len+1);
 				memcpy(str, bytes, len);
 				str[len] = 0;
 				var->type |= SCRIPT_FREE;
Index: eggdrop1.9/modules/telnetparty/events.c
diff -u eggdrop1.9/modules/telnetparty/events.c:1.11 eggdrop1.9/modules/telnetparty/events.c:1.12
--- eggdrop1.9/modules/telnetparty/events.c:1.11	Sat Jan 13 06:23:40 2007
+++ eggdrop1.9/modules/telnetparty/events.c	Sat Apr 14 10:21:13 2007
@@ -18,16 +18,16 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: events.c,v 1.11 2007-01-13 12:23:40 sven Exp $";
+static const char rcsid[] = "$Id: events.c,v 1.12 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
 #include "telnetparty.h"
 
-static int on_privmsg(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len);
+static int on_privmsg(void *client_data, partymember_t *dest, botnet_entity_t *src, const char *text, int len);
 static int on_nick(void *client_data, partymember_t *src, const char *oldnick, const char *newnick);
 static int on_quit(void *client_data, partymember_t *src, const botnet_bot_t *lostbot, const char *text, int len);
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len);
 static int on_join(void *client_data, partychan_t *chan, partymember_t *src, int linking);
 static int on_part(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
 
@@ -40,7 +40,7 @@
 	on_part
 };
 
-static int on_privmsg(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len)
+static int on_privmsg(void *client_data, partymember_t *dest, botnet_entity_t *src, const char *text, int len)
 {
 	return partyline_idx_privmsg (((telnet_session_t *)client_data)->idx, dest, src, text, len);
 }
@@ -60,7 +60,7 @@
 	return(0);
 }
 
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len)
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len)
 {
 	return partyline_idx_chanmsg (((telnet_session_t *)client_data)->idx, chan, src, text, len);
 }
Index: eggdrop1.9/modules/telnetparty/telnetparty.c
diff -u eggdrop1.9/modules/telnetparty/telnetparty.c:1.24 eggdrop1.9/modules/telnetparty/telnetparty.c:1.25
--- eggdrop1.9/modules/telnetparty/telnetparty.c:1.24	Sat Jan 13 06:23:41 2007
+++ eggdrop1.9/modules/telnetparty/telnetparty.c	Sat Apr 14 10:21:13 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: telnetparty.c,v 1.24 2007-01-13 12:23:41 sven Exp $";
+static const char rcsid[] = "$Id: telnetparty.c,v 1.25 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -474,7 +474,7 @@
 	int type, arg, remove;
 	telnet_session_t *session = client_data;
 
-	cmd = data;
+	cmd = (unsigned char *) data;
 	while ((cmd = memchr(cmd, TELNET_CMD, len))) {
 		type = *(cmd+1);
 		switch (type) {
Index: eggdrop1.9/src/core_party.c
diff -u eggdrop1.9/src/core_party.c:1.53 eggdrop1.9/src/core_party.c:1.54
--- eggdrop1.9/src/core_party.c:1.53	Fri Dec  1 22:05:11 2006
+++ eggdrop1.9/src/core_party.c	Sat Apr 14 10:21:13 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: core_party.c,v 1.53 2006-12-02 04:05:11 sven Exp $";
+static const char rcsid[] = "$Id: core_party.c,v 1.54 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -137,6 +137,7 @@
 {
 	char *who;
 	const char *next;
+	botnet_entity_t src = user_entity(p);
 	partymember_t *dest;
 
 	egg_get_arg(text, &next, &who);
@@ -151,7 +152,7 @@
 		goto done;
 	}
 
-	partymember_msg(dest, p, next, -1);
+	partymember_msg(dest, &src, next, -1);
 done:
 	if (who) free(who);
 	return(0);
@@ -444,6 +445,7 @@
 {
 	char *botname;
 	const char *reason;
+	botnet_entity_t src = user_entity(p);
 	botnet_bot_t *bot;
 
 	egg_get_arg(text, &reason, &botname);
@@ -459,7 +461,7 @@
 		partymember_printf(p, _("Not connected to that bot."));
 		return 0;
 	}
-	botnet_unlink(p, bot, reason);
+	botnet_unlink(&src, bot, reason);
 	return 0;
 }
 
Index: eggdrop1.9/src/terminal.c
diff -u eggdrop1.9/src/terminal.c:1.8 eggdrop1.9/src/terminal.c:1.9
--- eggdrop1.9/src/terminal.c:1.8	Sat Jan 13 06:23:41 2007
+++ eggdrop1.9/src/terminal.c	Sat Apr 14 10:21:13 2007
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: terminal.c,v 1.8 2007-01-13 12:23:41 sven Exp $";
+static const char rcsid[] = "$Id: terminal.c,v 1.9 2007-04-14 15:21:13 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>			/* partyline_*		*/
@@ -26,10 +26,10 @@
 
 extern int terminal_enabled; /* from logfile.c */
 
-static int on_privmsg(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len);
+static int on_privmsg(void *client_data, partymember_t *dest, botnet_entity_t *src, const char *text, int len);
 static int on_nick(void *client_data, partymember_t *src, const char *oldnick, const char *newnick);
 static int on_quit(void *client_data, partymember_t *src, const botnet_bot_t *lostbot, const char *text, int len);
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len);
 static int on_join(void *client_data, partychan_t *chan, partymember_t *src, int linking);
 static int on_part(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len);
 static int on_read(void *client_data, int idx, char *data, int len);
@@ -138,7 +138,7 @@
 	return 0;
 }
 
-static int on_privmsg(void *client_data, partymember_t *dest, partymember_t *src, const char *text, int len)
+static int on_privmsg(void *client_data, partymember_t *dest, botnet_entity_t *src, const char *text, int len)
 {
 	return partyline_idx_privmsg(terminal_session.out_idx, dest, src, text, len);
 }
@@ -160,7 +160,7 @@
 	return(0);
 }
 
-static int on_chanmsg(void *client_data, partychan_t *chan, partymember_t *src, const char *text, int len)
+static int on_chanmsg(void *client_data, partychan_t *chan, botnet_entity_t *src, const char *text, int len)
 {
 	return partyline_idx_chanmsg(terminal_session.out_idx, chan, src, text, len);
 }
----------------------- End of diff -----------------------



More information about the Changes mailing list