Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %hook WAMessageContainerView
- - (void)updateBubbleImageView {
- %orig;
- if (enableColor) {
- return;
- }
- WAMessage *message = nil;
- if ([self respondsToSelector:@selector(message)]) {
- message = self.message;
- } else if ([self respondsToSelector:@selector(cellData)]) {
- message = self.cellData.message;
- }
- _WANoHighlightImageView *customBubbleImageView;
- object_getInstanceVariable(self, "_bubbleImageView");
- if (enableColor) {
- return;
- }
- customBubbleImageView.image = [customBubbleImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
- BOOL isAudioSliceView = NO;
- if ([self respondsToSelector:@selector(audioSliceView)]) {
- isAudioSliceView = [self audioSliceView] != nil;
- } else if ([self.sliceViews count] > 0) {
- isAudioSliceView = [self.sliceViews[0] isKindOfClass:%c(WAMessageAudioSliceView)];
- }
- if (message.isFromMe) {
- if (isAudioSliceView) {
- customBubbleImageView.tintColor = LCPParseColorString([CPSettings objectForKey:@"textColor1"], @"#FFFFFF");
- } else {
- customBubbleImageView.tintColor = LCPParseColorString([CPSettings objectForKey:@"textColor1"], @"#FFFFFF");
- }
- } else if (!message.canBeForwarded) {
- customBubbleImageView.tintColor = LCPParseColorString([CPSettings objectForKey:@"textColor1"], @"#FFFFFF");
- } else {
- if (isAudioSliceView) {
- customBubbleImageView.tintColor = LCPParseColorString([CPSettings objectForKey:@"textColor1"], @"#FFFFFF");
- } else {
- customBubbleImageView.tintColor = LCPParseColorString([CPSettings objectForKey:@"textColor1"], @"#FFFFFF");
- }
- }
- }
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement