+
+ /** Retrieves the name of the target of this message. */
+ const std::string& GetName() const
+ {
+ switch (type)
+ {
+ case TYPE_CHANNEL:
+ return Get<Channel>()->name;
+ case TYPE_USER:
+ return Get<User>()->nick;
+ case TYPE_SERVER:
+ return *Get<std::string>();
+ }
+
+ // We should never reach this point during a normal execution but
+ // handle it just in case.
+ static const std::string target = "*";
+ return target;
+ }