<commit_before>/*
 * otr4j, the open source java otr library.
 * 
 * Distributable under LGPL license. See terms of license at gnu.org.
 */
package net.java.otr4j.session;

import info.guardianproject.otr.app.im.engine.Address;

/** @author <NAME> */
public final class SessionID {

    private String mLocalUserId;
    private String mRemoteUserId;
    private String mProtocolName;

    private String mSessionId;

    public static final SessionID Empty = new SessionID(null, null, null);

    public SessionID(String localUserId, String remoteUserId, String protocolName) {
       mLocalUserId = localUserId;
       mRemoteUserId = remoteUserId;
       mProtocolName = protocolName;
       
       if (mLocalUserId != null)
           mSessionId = Address.stripResource(mLocalUserId) + '_' + mProtocolName + '_' + Address.stripResource(mRemoteUserId);
       
    }

    public String getLocalUserId ()
    {
        return mLocalUserId;
    }
    
    public String getRemoteUserId ()
    {
        return mRemoteUserId;
    }
    
    //this is only used for resource changes
    public void updateRemoteUserId (String remoteUserId)
    {        
        mRemoteUserId = remoteUserId;
    }   
    
    public String getSessionId ()
    {
        return mSessionId;
    }
    
    public String getProtocolName ()
    {
        return mProtocolName;
    }<commit_msg>don't update remote sessions; if jabberid changes, create new session<commit_after>/*
 * otr4j, the open source java otr library.
 * 
 * Distributable under LGPL license. See terms of license at gnu.org.
 */
package net.java.otr4j.session;

import info.guardianproject.otr.app.im.engine.Address;

/** @author <NAME> */
public final class SessionID {

    private String mLocalUserId;
    private String mRemoteUserId;
    private String mProtocolName;

    private String mSessionId;

    public static final SessionID Empty = new SessionID(null, null, null);

    public SessionID(String localUserId, String remoteUserId, String protocolName) {
       mLocalUserId = localUserId;
       mRemoteUserId = remoteUserId;
       mProtocolName = protocolName;
       
       if (mLocalUserId != null)
           mSessionId = Address.stripResource(mLocalUserId) + '_' + mProtocolName + '_' + Address.stripResource(mRemoteUserId);
       //mSessionId = mLocalUserId + '_' + mProtocolName + '_' + mRemoteUserId;
       
    }

    public String getLocalUserId ()
    {
        return mLocalUserId;
    }
    
    public String getRemoteUserId ()
    {
        return mRemoteUserId;
    }
    
    public String getSessionId ()
    {
        return mSessionId;
    }
    
    public String getProtocolName ()
    {
        return mProtocolName;
    }
{'fraction_non_alphanumeric': 0.07995578481945467, 'fraction_numerical': 0.0014738393515106854, 'mean_word_length': 2.624833110814419, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5702481', 'n_tokens_mistral': 769, 'n_tokens_neox': 788, 'n_words': 205}