Add torrent_resumed alert

This commit is contained in:
Andrew Resch 2008-06-08 05:14:40 +00:00
parent 840f9be276
commit 3ea075f169
3 changed files with 18 additions and 0 deletions

View File

@ -271,4 +271,8 @@ void bind_alert()
)
.def_readonly("name", &file_renamed_alert::name)
;
class_<torrent_resumed_alert, bases<torrent_alert>, noncopyable>(
"torrent_resumed_alert", no_init
);
}

View File

@ -544,6 +544,15 @@ namespace libtorrent
{ return std::auto_ptr<alert>(new peer_blocked_alert(*this)); }
};
struct TORRENT_EXPORT torrent_resumed_alert: torrent_alert
{
torrent_resumed_alert(torrent_handle const& h, std::string const& msg)
: torrent_alert(h, alert::warning, msg)
{}
virtual std::auto_ptr<alert> clone() const
{ return std::auto_ptr<alert>(new torrent_resumed_alert(*this)); }
};
}

View File

@ -3686,6 +3686,11 @@ namespace libtorrent
m_started = time_now();
m_error.clear();
if (alerts().should_post(alert::warning))
{
alerts().post_alert(torrent_resumed_alert(get_handle(), "torrent resumed"));
}
// tell the tracker that we're back
m_event = tracker_request::started;
force_tracker_request();