// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsConversationService.java
// public static final class PgpChatId extends ConversationId
// {
// 	public String getDestPgpId() { return mPgpId; }
// 	@Override public ConversationKind getConversationKind(){ return ConversationKind.PGP_CHAT; }
// 	@Override public boolean equals(Object o)
// 	{
// 		if(o == null) return false;
// 		PgpChatId c1;
// 		try { c1 = (PgpChatId) o; }
// 		catch (ClassCastException e) { return false; }
// 
// 		return mPgpId.equalsIgnoreCase(c1.getDestPgpId());
// 	}
// 	@Override public int hashCode() { return mPgpId.hashCode(); }
// 	@Override public void writeToParcel(Parcel parcel, int i) { parcel.writeString(mPgpId); }
// 
// 	public static final Parcelable.Creator<PgpChatId> CREATOR = new Parcelable.Creator<PgpChatId>()
// 	{
// 		public PgpChatId createFromParcel(Parcel in) { return PgpChatId.Factory.getPgpChatId(in.readString()); }
// 		public PgpChatId[] newArray(int size) { return new PgpChatId[size]; }
// 	};
// 
// 	public static final class Factory
// 	{
// 		public static PgpChatId getPgpChatId(String destinationPgpId)
// 		{
// 			PgpChatId ret = repository.get(destinationPgpId);
// 			if(ret == null)
// 			{
// 				ret = new PgpChatId(destinationPgpId);
// 				repository.put(destinationPgpId, ret);
// 			}
// 			return ret;
// 		}
// 		private static final Map<String, PgpChatId> repository = new WeakHashMap<String, PgpChatId>();
// 	}
// 
// 	private PgpChatId(String destPgpId) { mPgpId = destPgpId; }
// 	private final String mPgpId;
// }


import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import org.retroshare.android.RsConversationService.PgpChatId;
/**
 * @license
 *
 * Copyright (c) 2013 Gioacchino Mazzurco <gio@eigenlab.org>.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package org.retroshare.android;




public class ContactMethodChooserActivity extends Activity
{
	public String TAG() { return "ContactMethodChooserActivity"; }

	private String serverName;
	private String pgpId;


	@Override
    public void onCreate(Bundle savedInstanceState)
    {
		super.onCreate(savedInstanceState);

		Log.d(TAG(), "onCreate(Bundle savedInstanceState)");

		Uri uri = getIntent().getData();
        if ( uri != null )
        {
			String sp[] = uri.getPath().split("/");

			serverName = sp[1];
			pgpId = sp[2];

			Intent i = new Intent(this, ConversationFragmentActivity.class);
			i.putExtra(ConversationFragmentActivity.SERVER_NAME_EXTRA_KEY, serverName);
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsConversationService.java
// public static final class PgpChatId extends ConversationId
// {
// 	public String getDestPgpId() { return mPgpId; }
// 	@Override public ConversationKind getConversationKind(){ return ConversationKind.PGP_CHAT; }
// 	@Override public boolean equals(Object o)
// 	{
// 		if(o == null) return false;
// 		PgpChatId c1;
// 		try { c1 = (PgpChatId) o; }
// 		catch (ClassCastException e) { return false; }
// 
// 		return mPgpId.equalsIgnoreCase(c1.getDestPgpId());
// 	}
// 	@Override public int hashCode() { return mPgpId.hashCode(); }
// 	@Override public void writeToParcel(Parcel parcel, int i) { parcel.writeString(mPgpId); }
// 
// 	public static final Parcelable.Creator<PgpChatId> CREATOR = new Parcelable.Creator<PgpChatId>()
// 	{
// 		public PgpChatId createFromParcel(Parcel in) { return PgpChatId.Factory.getPgpChatId(in.readString()); }
// 		public PgpChatId[] newArray(int size) { return new PgpChatId[size]; }
// 	};
// 
// 	public static final class Factory
// 	{
// 		public static PgpChatId getPgpChatId(String destinationPgpId)
// 		{
// 			PgpChatId ret = repository.get(destinationPgpId);
// 			if(ret == null)
// 			{
// 				ret = new PgpChatId(destinationPgpId);
// 				repository.put(destinationPgpId, ret);
// 			}
// 			return ret;
// 		}
// 		private static final Map<String, PgpChatId> repository = new WeakHashMap<String, PgpChatId>();
// 	}
// 
// 	private PgpChatId(String destPgpId) { mPgpId = destPgpId; }
// 	private final String mPgpId;
// }


// Path: RetroShareAndroidIntegration/src/org/retroshare/android/ContactMethodChooserActivity.java
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import org.retroshare.android.RsConversationService.PgpChatId;

/**
 * @license
 *
 * Copyright (c) 2013 Gioacchino Mazzurco <gio@eigenlab.org>.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package org.retroshare.android;




public class ContactMethodChooserActivity extends Activity
{
	public String TAG() { return "ContactMethodChooserActivity"; }

	private String serverName;
	private String pgpId;


	@Override
    public void onCreate(Bundle savedInstanceState)
    {
		super.onCreate(savedInstanceState);

		Log.d(TAG(), "onCreate(Bundle savedInstanceState)");

		Uri uri = getIntent().getData();
        if ( uri != null )
        {
			String sp[] = uri.getPath().split("/");

			serverName = sp[1];
			pgpId = sp[2];

			Intent i = new Intent(this, ConversationFragmentActivity.class);
			i.putExtra(ConversationFragmentActivity.SERVER_NAME_EXTRA_KEY, serverName);
			i.putExtra(ConversationFragmentActivity.CONVERSATION_ID_EXTRA_KEY, PgpChatId.Factory.getPgpChatId(pgpId));