Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Drops avatar sent in transcriptions. #544

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ public class LocalJsonTranscriptHandler
*/
public final static String JSON_KEY_PARTICIPANT_EMAIL = "email";

/**
* This fields stores the URL of the avatar of a participant as a string
*/
public final static String JSON_KEY_PARTICIPANT_AVATAR_URL = "avatar_url";

/**
* This fields stores the identity username of a participant as a string
*/
Expand Down Expand Up @@ -401,13 +396,6 @@ private static void addParticipantDescription(JSONObject pJSON,
pJSON.put(JSON_KEY_PARTICIPANT_EMAIL, email);
}

// adds avatar-url if it exists
String avatarUrl = participant.getAvatarUrl();
if (avatarUrl != null)
{
pJSON.put(JSON_KEY_PARTICIPANT_AVATAR_URL, avatarUrl);
}

// add identity information if it exists
String identityUsername = participant.getIdentityUserName();
if (identityUsername != null)
Expand Down
84 changes: 1 addition & 83 deletions src/main/java/org/jitsi/jigasi/transcription/Participant.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import net.java.sip.communicator.impl.protocol.jabber.*;
import net.java.sip.communicator.service.protocol.*;
import org.jitsi.jigasi.util.Util;
import org.jitsi.xmpp.extensions.jitsimeet.*;
import org.jitsi.utils.logging.*;
import org.jivesoftware.smack.packet.*;
Expand All @@ -32,7 +31,7 @@
/**
* This class describes a participant in a conference whose
* transcription is required. It manages the transcription if its own audio
* will locally buffered until enough audio is collected
* will locally buffer it until enough audio is collected
*
* @author Nik Vaessen
* @author Boris Grozev
Expand Down Expand Up @@ -80,21 +79,6 @@ public class Participant
*/
public static final long DEFAULT_UNKNOWN_AUDIO_SSRC = -1;

/**
* The standard URL to a gravatar avatar which still needs to be formatted
* with the ID. The ID can be received by hasing the email with md5
*/
private final static String GRAVARAR_URL_FORMAT
= "https://www.gravatar.com/avatar/%s?d=wavatar&size=200";

/**
* The standard url to a meeple avatar by using a random ID. Default usage
* when email not known, but using `avatar-id` does not actually result
* int he same meeple
*/
private final static String MEEPLE_URL_FORMAT
= "https://abotars.jitsi.net/meeple/%s";

/**
* The {@link Transcriber} which owns this {@link Participant}.
*/
Expand Down Expand Up @@ -245,60 +229,6 @@ public String getEmail()
return ((ChatRoomMemberJabberImpl) chatMember).getEmail();
}

/**
* @return the URL of the avatar of the participant, if one is set.
*/
public String getAvatarUrl()
{
if (chatMember == null)
{
return null;
}
if (!(chatMember instanceof ChatRoomMemberJabberImpl))
{
return null;
}

ChatRoomMemberJabberImpl memberJabber
= ((ChatRoomMemberJabberImpl) this.chatMember);

IdentityPacketExtension ipe = getIdentityExtensionOrNull(
memberJabber.getLastPresence());

String url;
if (ipe != null && (url = ipe.getUserAvatarUrl()) != null)
{
return url;
}
else if ((url = memberJabber.getAvatarUrl()) != null)
{
return url;
}

String email;
if ((email = getEmail()) != null)
{
return String.format(GRAVARAR_URL_FORMAT,
Util.stringToMD5hash(email));
}

// Create a nice looking meeple avatar when avatar-url nor email is set
AvatarIdPacketExtension avatarIdExtension = getAvatarIdExtensionOrNull(
memberJabber.getLastPresence());
String avatarId;
if (avatarIdExtension != null &&
(avatarId = avatarIdExtension.getAvatarId()) != null)
{
return String.format(MEEPLE_URL_FORMAT,
Util.stringToMD5hash(avatarId));
}
else
{
return String.format(MEEPLE_URL_FORMAT,
Util.stringToMD5hash(identifier));
}
}

/**
* Get the user-name in the identity presence, if present
*
Expand Down Expand Up @@ -389,18 +319,6 @@ private IdentityPacketExtension getIdentityExtensionOrNull(Presence p)
return p.getExtension(IdentityPacketExtension.class);
}

/**
* Get the {@link AvatarIdPacketExtension} inside a {@link Presence} or null
* when it's not inside
*
* @param p the presence
* @return the {@link AvatarIdPacketExtension} or null
*/
private AvatarIdPacketExtension getAvatarIdExtensionOrNull(Presence p)
{
return p.getExtension(AvatarIdPacketExtension.class);
}

private TranscriptionRequestExtension
getTranscriptionRequestExtensionOrNull(Presence p)
{
Expand Down
Loading