Fix GetText() for CTCP [ACTION]

Just like the recent problem with smileys; TrimLeft() is not the same
than TrimPrefix(), and TrimRight() is not the same than TrimSuffix().
This commit is contained in:
J-P Nurmi
2015-08-23 00:48:35 +02:00
parent 6e15ee2eea
commit e1ae565e6f
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -89,13 +89,13 @@ private:
class CChanAction : public CMessage {
public:
CString GetText() const { return GetParam(1).TrimLeft_n("\001ACTION ").TrimRight_n("\001"); }
CString GetText() const { return GetParam(1).TrimPrefix_n("\001ACTION ").TrimSuffix_n("\001"); }
void SetText(const CString& sText) { SetParam(1, "\001ACTION " + sText + "\001"); }
};
class CChanCTCP : public CMessage {
public:
CString GetText() const { return GetParam(1).TrimLeft_n("\001").TrimRight_n("\001"); }
CString GetText() const { return GetParam(1).TrimPrefix_n("\001").TrimSuffix_n("\001"); }
void SetText(const CString& sText) { SetParam(1, "\001" + sText + "\001"); }
};
@@ -138,13 +138,13 @@ public:
class CPrivAction : public CMessage {
public:
CString GetText() const { return GetParam(1).TrimLeft_n("\001ACTION ").TrimRight_n("\001"); }
CString GetText() const { return GetParam(1).TrimPrefix_n("\001ACTION ").TrimSuffix_n("\001"); }
void SetText(const CString& sText) { SetParam(1, "\001ACTION " + sText + "\001"); }
};
class CPrivCTCP : public CMessage {
public:
CString GetText() const { return GetParam(1).TrimLeft_n("\001").TrimRight_n("\001"); }
CString GetText() const { return GetParam(1).TrimPrefix_n("\001").TrimSuffix_n("\001"); }
void SetText(const CString& sText) { SetParam(1, "\001" + sText + "\001"); }
};