mirror of https://github.com/sipwise/jitsi.git
parent
63c9ed630a
commit
05f4510756
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.plugin.otr;
|
||||
|
||||
import java.awt.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* Class for storing OTR functions used by the menus, buttons, links, etc.
|
||||
*
|
||||
* @author Daniel Perren
|
||||
*/
|
||||
class OtrActionHandlers
|
||||
{
|
||||
/**
|
||||
* Opening the standard authorisation dialog for OTR fingerprints.
|
||||
*
|
||||
* @param contact the contact you would like to authenticate.
|
||||
*/
|
||||
static void openAuthDialog(Contact contact)
|
||||
{
|
||||
// Launch auth buddy dialog.
|
||||
OtrBuddyAuthenticationDialog authenticateBuddyDialog =
|
||||
new OtrBuddyAuthenticationDialog(contact);
|
||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
|
||||
authenticateBuddyDialog.setLocation(screenSize.width / 2
|
||||
- authenticateBuddyDialog.getWidth() / 2, screenSize.height / 2
|
||||
- authenticateBuddyDialog.getHeight() / 2);
|
||||
authenticateBuddyDialog.setVisible(true);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.plugin.otr;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.otr4j.session.*;
|
||||
|
||||
/**
|
||||
* Class used to associate a random UUID to an OTR4J SessionID.
|
||||
*
|
||||
* @author Daniel Perren
|
||||
*/
|
||||
|
||||
public class ScSessionID
|
||||
{
|
||||
private SessionID sessionID;
|
||||
private UUID guid = UUID.randomUUID();
|
||||
|
||||
/**
|
||||
* Creates a new instance of this class.
|
||||
* @param sessionID the OTR4J SessionID that is being wrapped.
|
||||
*/
|
||||
public ScSessionID(SessionID sessionID)
|
||||
{
|
||||
this.sessionID = sessionID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the wrapped session ID
|
||||
*
|
||||
* @return sessionID
|
||||
*/
|
||||
public SessionID getSessionID()
|
||||
{
|
||||
return sessionID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link SessionID#hashCode()} of the wrapped SessionID.
|
||||
* @return HashCode of the wrapped SessionID.
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return sessionID.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current GUID.
|
||||
*
|
||||
* @return The GUID generated for this SessionID.
|
||||
*/
|
||||
public UUID getGUID()
|
||||
{
|
||||
return guid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides equals() for the ability to get the hashcode from sessionID.
|
||||
* @param obj the object to compare
|
||||
* @return true if the objects are considered equal.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if(obj == null)
|
||||
return false;
|
||||
return sessionID.toString().equals(obj.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link SessionID#toString()} of the wrapped SessionID.
|
||||
* @return String representation of the wrapped SessionID.
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return sessionID.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.gui;
|
||||
|
||||
import java.net.*;
|
||||
|
||||
/**
|
||||
* Event-callback for clicks on links.
|
||||
*
|
||||
* @author Daniel Perren
|
||||
*/
|
||||
public interface ChatLinkClickedListener
|
||||
{
|
||||
/**
|
||||
* Callback that is executed when a link was clicked.
|
||||
*
|
||||
* @param url The URI of the link that was clicked.
|
||||
*/
|
||||
public void chatLinkClicked(URI url);
|
||||
}
|
||||
Loading…
Reference in new issue