forked from premiere/premiere-libtorrent
Add torrent_resumed alert
This commit is contained in:
parent
840f9be276
commit
3ea075f169
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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)); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue