package org.springframework.social.common.api.dict;

/**
 * @author Anton Leliuk
 */
public enum ActivityType {

    unknown("unknown"),
//    error,
//    personalMessage,
//    groupMessage,
    text_message("message/text"),
    message("message"),
//    threadBotAdded,
//    threadBotRemoved,
//    threadAddMember,
//    threadRemoveMember,
//    threadTopicUpdated,
//    threadHistoryDisclosedUpdate,
//    contactAdded,
//    contactRemoved,
    attachment("message/image"),
    contactRelationUpdate("activity/contactRelationUpdate"),
    conversationUpdate("activity/conversationUpdate"),
    typing("activity/typing"),
    ping("activity/ping"),
    deleteUserData("activity/deleteUserData"),
    card("message/card.carousel");

    private String realType;

    ActivityType(String realType) {
        this.realType = realType;
    }

    public static ActivityType getInstance(String key){
        for (ActivityType type : values()) {
            if(type.getRealType().equals(key)){
                return type;
            }
        }
        System.out.println("Unknown activity type - " + key);
        return unknown;
    }

    public String getRealType() {
        return realType;
    }
}

@@ -633,25 +633,16 @@
   ping(%22
-activity/
 ping%22),%0A

Fix ping activity