mirror of
https://github.com/znc/znc.git
synced 2026-05-01 02:52:30 +02:00
Added static function Concat() for catting a suffix onto a nick
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@313 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
8
Nick.cpp
8
Nick.cpp
@@ -18,6 +18,14 @@ void CNick::Reset() {
|
||||
m_cPerm = '\0';
|
||||
}
|
||||
|
||||
CString CNick::Concat(const CString& sNick, const CString& sSuffix, unsigned int uMaxNickLen) {
|
||||
if (sSuffix.length() >= uMaxNickLen) {
|
||||
return sSuffix.Left(uMaxNickLen);
|
||||
}
|
||||
|
||||
return sNick.Left(uMaxNickLen - sSuffix.length()) + sSuffix;
|
||||
}
|
||||
|
||||
void CNick::Parse(const CString& sNickMask) {
|
||||
if (sNickMask.empty()) {
|
||||
return;
|
||||
|
||||
1
Nick.h
1
Nick.h
@@ -23,6 +23,7 @@ public:
|
||||
void Parse(const CString& sNickMask);
|
||||
CString GetHostMask() const;
|
||||
unsigned int GetCommonChans(vector<CChan*>& vChans, CUser* pUser) const;
|
||||
static CString Concat(const CString& sNick, const CString& sSuffix, unsigned int uMaxNickLen = 9);
|
||||
|
||||
// Setters
|
||||
void SetUser(CUser* pUser);
|
||||
|
||||
Reference in New Issue
Block a user