Exemplo n.º 1
0
void notice(bd::String target, bd::String msg, int idx) {
  struct chanset_t* chan = NULL;
  if (have_cnotice && !strchr(CHANMETA, target[0]))
    chan = find_common_opped_chan(target);
  if (chan)
    dprintf(idx, "CNOTICE %s %s :%s\n", target.c_str(), chan->name, msg.c_str());
  else
    dprintf(idx, "NOTICE %s :%s\n", target.c_str(), msg.c_str());
}
Exemplo n.º 2
0
void notice(const char* target, const char* msg, int idx) {
  struct chanset_t* chan = NULL;
  if (have_cnotice && !strchr(CHANMETA, target[0]))
    chan = find_common_opped_chan(target);
  if (chan)
    dprintf(idx, "CNOTICE %s %s :%s\n", target, chan->name, msg);
  else
    dprintf(idx, "NOTICE %s :%s\n", target, msg);
}
Exemplo n.º 3
0
void privmsg(const char* target, const char* msg, int idx) {
  struct chanset_t* chan = NULL;
  if (have_cprivmsg && !strchr(CHANMETA, target[0]))
    chan = find_common_opped_chan(target);
  if (chan)
    dprintf(idx, "CPRIVMSG %s %s :%s\n", target, chan->name, msg);
  else
    dprintf(idx, "PRIVMSG %s :%s\n", target, msg);
}
Exemplo n.º 4
0
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]) && !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
    dprintf(idx, "PRIVMSG %s :%s\n", target.c_str(), msg.c_str());
}