$OpenBSD: patch-src_pork_command_c,v 1.3 2003/07/19 05:59:41 jolan Exp $
--- src/pork_command.c.orig	Thu Jul 10 11:25:24 2003
+++ src/pork_command.c	Sat Jul 19 00:12:47 2003
@@ -103,6 +103,7 @@ static const struct command command[] = 
 	{ "timer",		cmd_timer			},
 	{ "unalias",	cmd_unalias			},
 	{ "unbind",		cmd_unbind			},
+	{ "who",	cmd_who				},
 	{ "win",		cmd_win				},
 };
 
@@ -678,7 +679,7 @@ USER_COMMAND(cmd_history_list) {
 	if (cur == NULL)
 		return;
 
-	screen_win_msg(win, 0, 0, 0, "Command history:");
+	screen_write(win, "Command history:");
 
 	do {
 		char *entry = (char *) cur->data;
@@ -718,7 +719,7 @@ static const struct command buddy_comman
 	{ "remove_group",	cmd_buddy_remove_group	},
 	{ "remove_permit",	cmd_buddy_remove_permit	},
 	{ "report_idle",	cmd_buddy_report_idle	},
-	{ "search",			cmd_buddy_search		},
+	{ "search",			cmd_who		},
 	{ "seen",			cmd_buddy_seen			},
 	{ "unblock",		cmd_buddy_unblock		},
 	{ "warn",			cmd_buddy_warn			},
@@ -1067,13 +1068,6 @@ USER_COMMAND(cmd_buddy_report_idle) {
 		acct->username, (acct->report_idle ? "enabled" : "disabled"));
 }
 
-USER_COMMAND(cmd_buddy_search) {
-	struct pork_acct *acct = cur_window()->owner;
-
-	if (acct->proto->buddy_search != NULL && args != NULL)
-		acct->proto->buddy_search(acct, args);
-}
-
 USER_COMMAND(cmd_buddy_seen) {
 	struct pork_acct *acct = cur_window()->owner;
 	struct buddy *buddy;
@@ -1941,14 +1935,14 @@ USER_COMMAND(cmd_connect) {
 		acct = imwindow->owner;
 	}
 
-	if (acct->proto->connect == NULL)
-		return;
-
 	if (!acct->can_connect) {
 		screen_err_msg("You must specify a screen name before connecting");
 		return;
 	}
 
+	if (acct->proto->connect == NULL)
+		return;
+
 	if (acct->proto->connect(acct, args) == -1) {
 		screen_err_msg("Unable to login as %s", acct->username);
 		pork_acct_del_refnum(acct->refnum);
@@ -1959,7 +1953,7 @@ USER_COMMAND(cmd_connect) {
 
 USER_COMMAND(cmd_echo) {
 	if (args != NULL)
-		screen_win_msg(cur_window(), 0, 0, 1, "%s", args);
+		screen_write(cur_window(), args);
 }
 
 USER_COMMAND(cmd_disconnect) {
@@ -2022,12 +2016,12 @@ USER_COMMAND(cmd_help) {
 			screen_err_msg("Help: Error: No such command or section: %s",
 				section);
 		} else {
+			struct imwindow *win = cur_window();
 			if (pork_help_get_cmds(section, buf, sizeof(buf)) != -1) {
-				screen_win_msg(cur_window(), 0, 0, 0, " ");
+				screen_write(win, " ");
 				strtoupper(section);
-				screen_win_msg(cur_window(), 0, 0, 1, "%%W%s COMMANDS",
-					section);
-				screen_win_msg(cur_window(), 0, 0, 1, "\t%s", buf);
+				screen_win_msg(cur_window(), 0, 0, 1, "%%W%s COMMANDS", section);
+				screen_win_msg(win, 0, 0, 1, "\t%s", buf);
 				screen_output("Type /help %s <command> for the help text for a particular %s command.",
 					section, section);
 			}
@@ -2235,6 +2229,13 @@ USER_COMMAND(cmd_email) {
 }
 
 USER_COMMAND(cmd_passwd) {
+}
+
+USER_COMMAND(cmd_who) {
+	struct pork_acct *acct = cur_window()->owner;
+
+	if (acct->proto->who != NULL && args != NULL)
+		acct->proto->who(acct, args);
 }
 
 USER_COMMAND(cmd_perl) {
