Author Topic: imc2_to_pinkfish patch  (Read 1668 times)

Offline Tricky

  • BFF
  • ***
  • Posts: 189
  • I like what I code and I code what I like!
    • View Profile
imc2_to_pinkfish patch
« on: January 09, 2008, 05:01:59 pm »
I noticed that the IMC2 daemon wasn't converting colour codes into their respective pinkfish. So I added the following to the function channel_in.

Code: [Select]
          data["text"] = imc2_to_pinkfish(data["text"]);

Code: (/secure/daemon/imc2.c) [Select]
      void channel_in(string fromname, string frommud, mapping data){
          string sender;
          string localchan;

          int emote=0;

          sender=fromname+"@"+frommud;
          if(data["sender"]) sender = data["sender"];
          if(data["realfrom"]) sender = data["realfrom"];
          if(intp(data["text"])) data["text"]=sprintf("%d",data["text"]);
          if(data["emote"]) emote = data["emote"];
          //Following fix courtesy of Tricky
          if (emote == 1 && strsrch(data["text"], "$N") == -1)
              data["text"] = "$N " + data["text"];

          data["text"] = imc2_to_pinkfish(data["text"]);
          localchan = CHANNEL_BOT->GetLocalChannel(data["channel"]);
          CHANNEL_BOT->eventSendChannel(sender, localchan, data["text"], emote, "", "");
      }

Tricky