- Sone currentSone = getCurrentSone(request.getToadletContext());
- currentSone.addFriend(soneId);
- webInterface.getCore().saveSone(currentSone);
+ LocalSone currentSone = getCurrentSone(request.getToadletContext()).get();
+ String soneIds = request.getHttpRequest().getPartAsStringFailsafe("sone", 1200);
+ for (String soneId : soneIds.split("[ ,]+")) {
+ Optional<Sone> sone = webInterface.getCore().getSone(soneId);
+ if (sone.isPresent()) {
+ webInterface.getCore().followSone(currentSone, soneId);
+ webInterface.getCore().markSoneKnown(sone.get());
+ }
+ }