Commit Graph

16 Commits

Author SHA1 Message Date
Falk Seidel
8f73840e74 Welcome to 2016
🎆  Happy 2016 🎆
2016-01-01 20:11:21 +01:00
Alexey Sokolov
d185d6f22d clang-format: switch tabs to spaces
I like tabs, but I have to admit that spaces make source code more
consistent, because every editor/viewer tends to render tabs differently :(
2015-12-07 00:53:30 +00:00
Alexey Sokolov
33b0627d75 Add clang-format configuration.
For now, it uses tabs like before, to make the diff easier to read/check.
One of following commits will switch it to spaces.
2015-12-07 00:53:01 +00:00
J-P Nurmi
658db6bbe6 Make CMessage::ToString() use GetParams()
Avoids having the same loop in two places.

GetParams() was under consideration to be removed after the CMessage
porting work is done, but it's starting to look like it's here to stay.
There are cases, such as mode messages, where "get all params starting
from position N" is handy.
2015-09-20 23:22:03 +02:00
J-P Nurmi
ecb9b21055 Move message tags related code from CUtils to CMessage 2015-09-20 23:22:03 +02:00
J-P Nurmi
cbd860c2a9 Add CMessage::Equals()
Compares sender, command, and parameters. Not timestamp nor tags.
2015-09-20 23:22:02 +02:00
J-P Nurmi
6d42675a3a CMessage::SetParams(): forget the colon
1a3e9ec made CMessage try to retain the colon if the original message
contained one. We should not, however, remember that when the params
are replaced entirely. Consider for example an extended-join message
that is made suitable for a client that doesn't have extended-join
capability:

    CMessage msg(":nick!ident@host JOIN #chan account :real name");
    msg.SetParams({msg.GetParam(0)});
    msg.ToString(); // ":nick!ident@host JOIN :#chan"
2015-09-13 02:17:57 +02:00
J-P Nurmi
1a3e9ecb86 Resolve #1045: Make CMessage retain the colon
If the colon was there when parsed, stick it back even if it would be
technically unnecessary.
2015-09-10 00:21:04 +02:00
J-P Nurmi
5880bb4180 Add CMessage::GetType() 2015-09-07 00:00:25 +02:00
J-P Nurmi
2bee156316 CString CMessage::GetParams(): keep the colon, even at the beginning 2015-09-07 00:00:25 +02:00
J-P Nurmi
50ed9adf8a Fix CMessage::GetParams() crash - thanks kerio 2015-09-05 23:45:26 +02:00
J-P Nurmi
82375eed65 Add CMessage::Clone()
Due to (intentional) lack of CFooMessage::operator=(CMessage), it was
a bit clumsy to do such copy-conversions:

    CMessage Copy = Message;
    CJoinMessage& JoinMsg = static_cast<CJoinMessage&>(Copy);
    // ...

vs.

    CJoinMessge JoinMsg;
    JoinMsg.Clone(Message);
    // ...

Alternatively, copy ctor(CMessage) and assignment operator=(CMessage)
could have been added to all CMessage subclasses. I've been trying to
avoid that, to make these operations very explicit. It has helped a
lot so far by preventing accidental copies.
2015-08-30 15:50:12 +02:00
J-P Nurmi
37cd61a667 Fix CMessage to prefix also empty last params with a colon 2015-08-27 12:33:47 +02:00
J-P Nurmi
2ad2ee5620 Bring back the smileys - part II 2015-08-22 11:54:33 +02:00
J-P Nurmi
b8088a5b02 Fix CMessage::ToString() to ':' -prefix the last param when appropriate
Close #1037
2015-08-21 22:08:16 +02:00
J-P Nurmi
a06bf1c985 Introduce a Message type (#506) 2015-08-15 12:26:16 +02:00