use libtransmission's "can announce" functionality instead of custom mac code

This commit is contained in:
Mitchell Livingston 2007-07-30 22:19:52 +00:00
parent e677cb8017
commit e406ece219
3 changed files with 6 additions and 19 deletions

View File

@ -1324,8 +1324,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
NSDate * date;
while ((torrent = [enumerator nextObject]))
{
//time interval returned will be negative
if (!(date = [torrent announceDate]) || [date timeIntervalSinceNow] <= ANNOUNCE_WAIT_INTERVAL_SECONDS)
if ([torrent canAnnounce])
[torrent announce];
}
}
@ -2896,8 +2895,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
while ((torrent = [enumerator nextObject]))
{
//time interval returned will be negative
if ([torrent isActive] &&
(!(date = [torrent announceDate]) || [date timeIntervalSinceNow] <= ANNOUNCE_WAIT_INTERVAL_SECONDS))
if ([torrent canAnnounce])
return YES;
}
return NO;

View File

@ -37,8 +37,7 @@
int fID;
BOOL fResumeOnWake;
NSDate * fDateAdded, * fDateCompleted, * fAnnounceDate,
* fDateActivity;
NSDate * fDateAdded, * fDateCompleted, * fDateActivity;
BOOL fUseIncompleteFolder;
NSString * fDownloadFolder, * fIncompleteFolder;
@ -92,7 +91,7 @@
- (void) wakeUp;
- (void) announce;
- (NSDate *) announceDate;
- (BOOL) canAnnounce;
- (void) resetCache;

View File

@ -171,8 +171,6 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
[fDateCompleted release];
[fDateActivity release];
[fAnnounceDate release];
[fIcon release];
[fIconFlipped release];
[fIconSmall release];
@ -559,20 +557,12 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
- (void) announce
{
if (![self isActive])
return;
#warning doesn't work!
tr_manualUpdate(fHandle);
if (fAnnounceDate)
[fAnnounceDate release];
fAnnounceDate = [[NSDate date] retain];
}
- (NSDate *) announceDate
- (BOOL) canAnnounce
{
return fAnnounceDate;
return tr_torrentCanManualUpdate(fHandle);
}
- (void) resetCache