- /* we assign each status (op, halfop, voice, normal) a number
- * and compare them. this is easier than 100,000 if's and
- * returns :-)
- * -- yath */
-
- if (p1->other) {
- const char *other = (nick_prefix == NULL) ? NULL : strchr(nick_prefix, p1->other);
- status1 = (other == NULL) ? 5 : 1000 - (other - nick_prefix);
- } else if (p1->op)
- status1 = 4;
- else if (p1->halfop)
- status1 = 3;
- else if (p1->voice)
- status1 = 2;
- else
- status1 = 1;
-
- if (p2->other) {
- const char *other = (nick_prefix == NULL) ? NULL : strchr(nick_prefix, p2->other);
- status2 = (other == NULL) ? 5 : 1000 - (other - nick_prefix);
- } else if (p2->op)
- status2 = 4;
- else if (p2->halfop)
- status2 = 3;
- else if (p2->voice)
- status2 = 2;
- else
- status2 = 1;
-
- if (status1 < status2)
+ if (p1->prefixes[0] == p2->prefixes[0])
+ return g_strcasecmp(p1->nick, p2->nick);
+
+ if (!p1->prefixes[0])