Skip to content

Commit

Permalink
Fix additional friend info.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodit committed Jun 4, 2022
1 parent ae0a00c commit 0af0542
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Binary file modified app/libs/snapmod.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ class AdditionalFriendInfo(context: FeatureContext) : Feature(context) {
override fun performHooks() {
// Show more info in friend profile footer.
FriendProfileTransformer.apply.after(context, "more_profile_info") {
if (!FriendProfilePageData.isInstance(it.args[0]) || it.result !is List<*>) return@after
val transformer = FriendProfileTransformer.wrap(it.thisObject)
if (!FriendProfilePageData.isInstance(transformer.data) || it.result !is List<*>) return@after

val viewModelList = it.result as List<*>
if (viewModelList.isEmpty()) return@after

val viewModel = viewModelList[0]!!
if (!FooterInfoItem.isInstance(viewModel)) return@after

val data = FriendProfilePageData.wrap(it.args[0])
val data = FriendProfilePageData.wrap(transformer.data)
val friendDate = Date(max(data.addedTimestamp, data.reverseAddedTimestamp))
val birthday = if (data.birthday.isNull) CalendarDate(13, -1) else data.birthday

Expand Down
12 changes: 6 additions & 6 deletions snap.ds
Original file line number Diff line number Diff line change
Expand Up @@ -525,18 +525,18 @@ class FooterInfoItem {
}
}

class FriendProfileTransformer implements #Func2 {
class FriendProfileTransformer {

[discard] int i0;
[discard] Object target;
Object section;
Object data;

void $<init>(Object, int)
void $<init>(Object, Object, int)

* apply(...) {
* $apply(...) {
.string "Required value was null.";
.string "performanceLogger";
.method Collections->singletonList;
.field this->!target;
.new !FooterInfoItem;
}
}
Expand Down Expand Up @@ -1874,7 +1874,7 @@ class ProfileActionSheetProvider {
}
}

[certain]
[certain, conserve]
class ProfileActionSheetCreator {

Object nestedContext;
Expand Down

0 comments on commit 0af0542

Please sign in to comment.