Antidote-for-Tox / objcTox

No longer maintained
Mozilla Public License 2.0
37 stars 12 forks source link

OCTSubmanagerCalls, send cancel call control in dealloc #159

Closed Chuongv closed 8 years ago

Chuongv commented 8 years ago

It would beneficial to send a call control cancel to all calls prior to being dealloc. Currently if we just kill toxav, no notification is sent to peers*.

Related to https://github.com/Antidote-for-Tox/objcTox/issues/154

*https://github.com/irungentoo/toxcore/blob/master/toxav/toxav.h#L199

Chuongv commented 8 years ago

@dvor Do you know a good way I can send a cancel call control to all calls from OCTSubmanagerCalls? I was going to originally going to add a public method in OCTRealmManager to return RLMResults of all the calls. That way OCTSubmanagerCalls can just iterate over that container. But I'm not sure if that is something that OCTSubmanager should have access to? Perhaps I am over thinking this?

dvor commented 8 years ago

I think you can use - (RBQFetchRequest *)fetchRequestForClass:(Class)class withPredicate:(NSPredicate *)predicate; method of OCTRealmManager and then get all calls from fetch request.

dvor commented 8 years ago

Also you can check this method from file-transfer branch. Probably you can copy it from there.

dvor commented 8 years ago

Fixed