diff --git a/bindings/python/src/alert.cpp b/bindings/python/src/alert.cpp index aec3884e0..e01265ba8 100755 --- a/bindings/python/src/alert.cpp +++ b/bindings/python/src/alert.cpp @@ -28,6 +28,7 @@ extern char const* block_finished_alert_doc; extern char const* block_downloading_alert_doc; extern char const* storage_moved_alert_doc; extern char const* torrent_paused_alert_doc; +extern char const* torrent_resumed_alert_doc; extern char const* torrent_checked_alert_doc; extern char const* url_seed_alert_doc; extern char const* file_error_alert_doc; @@ -163,6 +164,10 @@ void bind_alert() "torrent_paused_alert", torrent_paused_alert_doc, no_init ); + class_, noncopyable>( + "torrent_resumed_alert", torrent_resumed_alert_doc, no_init + ); + class_, noncopyable>( "torrent_checked_alert", torrent_checked_alert_doc, no_init ); diff --git a/bindings/python/src/docstrings.cpp b/bindings/python/src/docstrings.cpp index 87d7e89c7..0a7e7bc5d 100755 --- a/bindings/python/src/docstrings.cpp +++ b/bindings/python/src/docstrings.cpp @@ -276,6 +276,9 @@ char const* torrent_paused_alert_doc = "It contains a `torrent_handle` to the torrent in question. This alert\n" "is generated as severity level `alert.severity_levels.warning`."; +char const* torrent_resumed_alert_doc = + ""; + char const* torrent_checked_alert_doc = ""; diff --git a/include/libtorrent/alert_types.hpp b/include/libtorrent/alert_types.hpp index a6aafef6a..6c445087a 100755 --- a/include/libtorrent/alert_types.hpp +++ b/include/libtorrent/alert_types.hpp @@ -301,6 +301,16 @@ namespace libtorrent { return std::auto_ptr(new torrent_paused_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 clone() const + { return std::auto_ptr(new torrent_resumed_alert(*this)); } + }; + struct TORRENT_EXPORT torrent_checked_alert: torrent_alert { torrent_checked_alert(torrent_handle const& h, std::string const& msg) diff --git a/src/torrent.cpp b/src/torrent.cpp index b745c40ba..ae08b89d2 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -3148,6 +3148,11 @@ namespace libtorrent m_paused = false; + 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();