On Saturday 30 April 2005 11:17 pm, tabris wrote:
>       I have a tentative patch for skip_target() that handles Unreal's
> multi-prefix NOTICEs. I'm thinking that it's a bit hackish atm
> however, so want to know how I can get access to the isupport
> PREFIXes so that I can support any prefix.
        Patch is attached, but there really should be another/better way to do 
this. However I'd need a way to get the isupport PREFIX array and 
iterate over it. I may work on this later, track down how it's stored.

>       I would appreciate pointers however on making this more universal,
> as I doubt that it will be accepted as-is.

-- 
Rube Walker: "Hey, Yogi, what time is it?"
Yogi Berra:  "You mean now?"
Index: src/fe-common/irc/fe-irc-commands.c
===================================================================
--- src/fe-common/irc/fe-irc-commands.c	(revision 3728)
+++ src/fe-common/irc/fe-irc-commands.c	(working copy)
@@ -43,13 +43,14 @@
 
 static const char *skip_target(const char *target)
 {
-	if (*target == '@') {
-		/* @#channel, @+#channel - Hybrid6 / Bahamut features */
-		if (target[1] == '+' && ischannel(target[2]))
-			target += 2;
-		else if (ischannel(target[1]))
-			target++;
-	}
+	int i = 0;
+	while ((target[i] == '~') || (target[i] == '&') || (target[i] == '@') || (target[i] == '%') || (target[i] == '+')) {
+		i++;
+	};
+
+	if(ischannel(target[i])) {
+		target += i;
+	};
 
 	return target;
 }
Index: src/fe-common/irc/fe-irc-messages.c
===================================================================
--- src/fe-common/irc/fe-irc-messages.c	(revision 3728)
+++ src/fe-common/irc/fe-irc-messages.c	(working copy)
@@ -39,13 +39,15 @@
 
 static const char *skip_target(const char *target)
 {
-	if (target != NULL && *target == '@') {
-		/* @#channel, @+#channel - Hybrid6 / Bahamut features */
-		if (target[1] == '+' && ischannel(target[2]))
-			target += 2;
-		else if (ischannel(target[1]))
-			target++;
-	}
+	int i = 0;
+	while ((target[i] == '~') || (target[i] == '&') ||
+		(target[i] == '@') || (target[i] == '%') || (target[i] == '+')) {
+		i++;
+	};
+
+	if(ischannel(target[i])) {
+		target += i;
+	};
 
 	return target;
 }

Attachment: pgpmqjKoEmhC5.pgp
Description: PGP signature

Reply via email to