Răsfoiți Sursa

* Use tokens to be more compatible with other FiSH implementations

Bryan Drewery 15 ani în urmă
părinte
comite
1c3b606ce5
1 a modificat fișierele cu 7 adăugiri și 4 ștergeri
  1. 7 4
      src/mod/server.mod/servmsg.c

+ 7 - 4
src/mod/server.mod/servmsg.c

@@ -888,11 +888,14 @@ static int gotnotice(char *from, char *msg)
         detect_flood(nick, uhost, from, FLOOD_NOTICE);
         u = get_user_by_host(from);
 
-        if (!strncmp(msg, "DH1080_INIT ", 12)) {
-          bd::String theirPublicKeyB64(msg + 12);
+        bd::String smsg(msg);
+        bd::String which = newsplit(smsg);
+
+        if (which == "DH1080_INIT") {
+          bd::String theirPublicKeyB64(newsplit(smsg));
           handle_DH1080_init(nick, uhost, from, u, theirPublicKeyB64);
-        } else if (!strncmp(msg, "DH1080_FINISH ", 14)) {
-          bd::String theirPublicKeyB64(msg + 14);
+        } else if (which == "DH1080_FINISH") {
+          bd::String theirPublicKeyB64(newsplit(smsg));
           handle_DH1080_finish(nick, uhost, from, u, theirPublicKeyB64);
         } else {
           putlog(LOG_MSGS, "*", "-%s (%s)- %s", nick, uhost, msg);