Remove "custom on success" logic from Image.

Create a new message element and message layout element type for mod badges.
This commit is contained in:
Rasmus Karlsson
2019-09-08 11:30:06 +02:00
committed by fourtf
parent 256a65a12e
commit dbce128cc3
8 changed files with 84 additions and 53 deletions
-10
View File
@@ -349,9 +349,6 @@ void Image::actuallyLoad()
if (!shared)
return Failure;
if (shared->customOnSuccess_)
return shared->customOnSuccess_(shared, result);
auto data = result.getData();
// const cast since we are only reading from it
@@ -396,11 +393,4 @@ bool Image::operator!=(const Image &other) const
return !this->operator==(other);
}
ImagePtr Image::setCustomOnSuccess(
std::function<Outcome(ImagePtr, NetworkResult)> customOnSuccess)
{
this->customOnSuccess_ = customOnSuccess;
return shared_from_this();
}
} // namespace chatterino