improved alert message when torrent doesn't have metadata

This commit is contained in:
Arvid Norberg 2009-10-31 23:28:37 +00:00
parent b97dcc8c58
commit 0e9bdd9e53
1 changed files with 10 additions and 1 deletions

View File

@ -51,7 +51,16 @@ namespace libtorrent
{}
virtual std::string message() const
{ return handle.is_valid()?handle.name():" - "; }
{
if (!handle.is_valid()) return " - ";
if (handle.name().empty())
{
char msg[41];
to_hex((char const*)&handle.info_hash()[0], 20, msg);
return msg;
}
return handle.name();
}
torrent_handle handle;
};