Commit 605c8287 authored by Romain Bignon's avatar Romain Bignon

can use wildcards to match buddies in /WHO

parent a4c4abc7
......@@ -17,6 +17,7 @@
*/
#include <cstring>
#include <fnmatch.h>
#include "core/caca_image.h"
#include "irc/irc.h"
......@@ -71,7 +72,8 @@ void IRC::m_who(Message message)
{
Nick* n = it->second;
string channame = "*";
if(arg.empty() || arg == "*" || arg == "0" || arg == n->getNickname() || n->getServer()->getServerName().find(arg) != string::npos)
if(arg.empty() || arg == "*" || arg == "0" || n->getServer()->getServerName().find(arg) != string::npos ||
!fnmatch(arg.c_str(), n->getNickname().c_str(), FNM_NOESCAPE|FNM_CASEFOLD))
{
vector<ChanUser*> chans = n->getChannels();
if(!chans.empty())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment