package com.skype.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.social.skypeBot.api.SkypeBot;
import org.springframework.social.skypeBot.api.data.to.Message;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Anton Leliuk
 */
@RestController
public class EchoController {

    @Autowired
    private SkypeBot skypeBot;

    @RequestMapping(value = "/chat", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
    public void chat(@RequestBody Object fromSkype){
//        System.out.println(fromSkype);
        Message toSkype = new Message();
        toSkype.setContent(ObjectUtils.nullSafeToString(fromSkype));
        skypeBot.sendMessage("8:anton_leliuk", toSkype);
    }
}

@@ -24,16 +24,40 @@
 oller;%0A%0A
+import java.util.List;%0A%0A
 import o
@@ -111,16 +111,16 @@
 owired;%0A
-
 import o
@@ -279,53 +279,8 @@
 ge;%0A
-import org.springframework.util.ObjectUtils;%0A
 impo
@@ -844,37 +844,91 @@
 ody 
-Object fromSkype
+List%3Corg.springframework.social.skypeBot.api.data.from.Message%3E messages
 )%7B%0A
-//
         
 Syst
@@ -927,39 +927,97 @@
     
-System.out.println(fromSkype);%0A
+for (org.springframework.social.skypeBot.api.data.from.Message message : messages) %7B%0A    
     
@@ -1061,16 +1061,20 @@
         
+    
 toSkype.
@@ -1088,106 +1088,103 @@
 ent(
-ObjectUtils.nullSafeToString(fromSkype));%0A        skypeBot.sendMessage(%228:anton_leliuk%22, toSkype);
+message.getContent());%0A            skypeBot.sendMessage(message.getFrom(), toSkype);%0A        %7D%0A
 %0A   

Test request