68 const std::string &name,
69 const std::string &channel,
70 const std::string &logName,
77 mChannelName(channel),
80 mAllowHightlight(true),
132 if (lineLim > 0 && line.length() > lineLim)
133 line = line.substr(0, lineLim);
143 const size_t pos = line.find(
" : ");
144 if (pos != std::string::npos)
146 if (line.length() <= pos + 3)
149 tmp.
nick = line.substr(0, pos);
150 tmp.
text = line.substr(pos + 3);
155 if (line.length() > 7 && line.substr(0, 7) ==
"Welcome")
161 tmp.
text.at(0) ==
'*' &&
162 tmp.
text.at(tmp.
text.length()-1) ==
'*')
165 tmp.
text.erase(tmp.
text.length() - 1);
169 std::string lineColor(
"##C");
173 if (tmp.
nick.empty())
176 tmp.
nick = std::string(
_(
"Global announcement:")).append(
" ");
183 tmp.
nick.c_str()).append(
" ");
188 tmp.
nick.append(
": ");
193 tmp.
nick.append(
": ");
223 if (tmp.
nick ==
": ")
234 && tmp.
text.length() > 1
235 && tmp.
text.at(0) ==
'#'
236 && tmp.
text.at(1) !=
'#')
239 || tmp.
nick.empty()))))
252 const tm *
const timeInfo = localtime(&t);
253 if (timeInfo !=
nullptr)
255 line =
strprintf(
"%s[%02d:%02d] %s%s", lineColor.c_str(),
256 timeInfo->tm_hour, timeInfo->tm_min, tmp.
nick.c_str(),
261 line =
strprintf(
"%s %s%s", lineColor.c_str(),
262 tmp.
nick.c_str(), tmp.
text.c_str());
268 std::stringstream timeStr;
269 timeStr <<
"[" << ((((t / 60) / 60) % 24 < 10) ?
"0" :
"")
271 <<
":" << (((t / 60) % 60 < 10) ?
"0" :
"")
274 line = std::string(lineColor).append(timeStr.str()).append(
313 if (tabArea ==
nullptr)
376 chatLog(std::string(nick).append(
" : ").append(
msg),
384 std::string
msg = message;
399 if (
msg.size() > 1 &&
443 const size_t pos =
msg.find(
' ');
444 const std::string type(
msg, 0, pos);
445 std::string args(
msg, pos == std::string::npos ?
msg.size() : pos + 1);
490 if (line.find(
"[@@http") == std::string::npos)
493 for (
size_t f = 0; f < line.length(); f++)
495 if (line.at(f) ==
' ')
514 std::list<std::string> list;
516 std::list<std::string>::const_iterator i = list.begin();
517 while (i != list.end())
519 std::string line(
"##o" + *i);
Net::ChatHandler * chatHandler
ChatMsgType ::T ChatMsgTypeT
static const unsigned int MAX_WORD_SIZE
ChatTabType ::T ChatTabTypeT
const std::string & getName() const
void setAlwaysUpdate(const bool n)
void setMaxRow(unsigned max)
void updateSize(const bool always)
void addRow(const std::string &row, const bool atTop)
void setLinkHandler(LinkHandler *linkHandler)
void setOpaque(Opaque opaque)
void loadLast(std::string name, std::list< std::string > &list, const unsigned int n) const
void log(std::string str)
ChatTab(const Widget2 *const widget, const std::string &name, const std::string &channel, const std::string &logName, const ChatTabTypeT &type)
void saveToLogFile(const std::string &msg) const
virtual void handleInput(const std::string &msg)
virtual bool handleCommand(const std::string &type, const std::string &args)
ChatTabTypeT getType() const
virtual void handleHelp(const std::string &msg)
void addRow(std::string &line)
bool getAllowHighlight() const
void addNewRow(std::string &line)
virtual bool handleCommands(const std::string &type, const std::string &args)
void scroll(const int amount)
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
void chatInput(const std::string &msg)
void showOnline(const std::string &nick, const Online online)
virtual void handleCommandStr(const std::string &msg)
void loadFromLogFile(const std::string &name)
virtual void playNewMessageSound() const
void addTab(ChatTab *const tab)
ItemLinkHandler * mItemLinkHandler
void removeTab(ChatTab *const tab)
static std::string doReplace(const std::string &msg)
bool findHighlight(const std::string &str)
void addToAwayLog(const std::string &line)
bool getBoolValue(const std::string &key) const
int getIntValue(const std::string &key) const
void search(const std::string &text)
virtual void talk(const std::string &text) const =0
KeyboardFocusT inputFocused
void playGuiSound(const std::string &name)
void setFlash(const int flash)
void setCaption(const std::string &caption)
TabbedArea * getTabbedArea() const
Tab * getSelectedTab() const
const bool IgnoreRecord_false
LocalPlayer * localPlayer
bool msg(InputEvent &event)
std::string trim(std::string const &str)
ServerTypeT getNetworkType()
static const std::string SOUND_GLOBAL
static const std::string SOUND_HIGHLIGHT
static const std::string SOUND_WHISPER
SoundManager soundManager
std::string removeColors(std::string msg)
std::string strprintf(const char *const format,...)
void replaceItemLinks(std::string &msg)
const bool TryRemoveColors_true
const bool TryRemoveColors_false