فهرست منبع

* Support '+p ' prefix on messages to not use FiSH

Bryan Drewery 15 سال پیش
والد
کامیت
e055f0db99
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      src/chanprog.c

+ 5 - 1
src/chanprog.c

@@ -968,11 +968,15 @@ void privmsg(bd::String target, bd::String msg, int idx) {
   struct chanset_t* chan = NULL;
   if (have_cprivmsg && !strchr(CHANMETA, target[0]))
     chan = find_common_opped_chan(target);
+  bool cleartextPrefix = (msg(0, 3) == "+p ");
 
   // Encrypt with FiSH?
-  if (!strchr(CHANMETA, target[0]) && FishKeys.contains(target) && FishKeys[target]->sharedKey.length()) {
+  if (!strchr(CHANMETA, target[0]) && !cleartextPrefix && FishKeys.contains(target) && FishKeys[target]->sharedKey.length()) {
     msg = "+OK " + egg_bf_encrypt(msg, FishKeys[target]->sharedKey);
   }
+  if (cleartextPrefix) {
+    msg += static_cast<size_t>(3);
+  }
   if (chan)
     dprintf(idx, "CPRIVMSG %s %s :%s\n", target.c_str(), chan->name, msg.c_str());
   else