Skip to content

Commit

Permalink
show new capabilities for friends
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Sep 14, 2024
1 parent 7262b7e commit d346f2f
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions src/main/java/com/zoffcc/applications/trifa/ToxVars.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public static class TOX_CAPABILITY_DECODE_RESULT
boolean toxav_h264 = false;
boolean msgv3 = false;
boolean ftv2 = false;
boolean toxav_h265 = false;
boolean ftv2a = false;
boolean next_implementation = false;
}

Expand All @@ -66,6 +68,8 @@ public static class TOX_CAPABILITY_DECODE_RESULT
public static long TOX_CAPABILITY_TOXAV_H264 = 1 << 2;
public static long TOX_CAPABILITY_MSGV3 = 1 << 3;
public static long TOX_CAPABILITY_FTV2 = 1 << 4;
public static long TOX_CAPABILITY_TOXAV_H265 = 1 << 5;
public static long TOX_CAPABILITY_FTV2A = 1 << 6;
public static long TOX_CAPABILITY_NEXT_IMPLEMENTATION = (1L << 63L);

public static TOX_CAPABILITY_DECODE_RESULT TOX_CAPABILITY_DECODE(long capabilites_encoded)
Expand Down Expand Up @@ -97,6 +101,16 @@ public static TOX_CAPABILITY_DECODE_RESULT TOX_CAPABILITY_DECODE(long capabilite
res.ftv2 = true;
}

if ((capabilites_encoded & TOX_CAPABILITY_TOXAV_H265) != 0)
{
res.toxav_h265 = true;
}

if ((capabilites_encoded & TOX_CAPABILITY_FTV2A) != 0)
{
res.ftv2a = true;
}

if ((capabilites_encoded & TOX_CAPABILITY_NEXT_IMPLEMENTATION) != 0)
{
res.next_implementation = true;
Expand Down Expand Up @@ -124,19 +138,29 @@ public static String TOX_CAPABILITY_DECODE_TO_STRING(TOX_CAPABILITY_DECODE_RESUL
res = res + " MSGV2 ";
}

if (in.toxav_h264)
{
res = res + " TOXAV_H264 ";
}

if (in.msgv3)
{
res = res + " MSGV3 ";
}

if (in.ftv2)
{
res = res + " FTV2 ";
}

if (in.toxav_h264)
if (in.toxav_h265)
{
res = res + " TOXAV_H264 ";
res = res + " TOXAV_H265 ";
}

if (in.msgv3)
if (in.ftv2a)
{
res = res + " MSGV3 ";
res = res + " FTV2a ";
}

if (in.next_implementation)
Expand Down

0 comments on commit d346f2f

Please sign in to comment.