public virtual void onFormMessage(User initiator, String fstreamid, SymphonyElementsAction fform)
 {
 }
Example #2
0
        private void handleEvents(List <DatafeedEvent> datafeedEvents)
        {
            foreach (DatafeedEvent eventv4 in datafeedEvents)
            {
                if (eventv4.initiator.user.userId != botClient.getBotUserInfo().id)
                {
                    switch (eventv4.type)
                    {
                    case "MESSAGESENT":

                        MessageSent messageSent = eventv4.payload.messageSent;
                        if (messageSent.message.stream.streamType.Equals("ROOM"))
                        {
                            foreach (RoomListener listener in roomListeners)
                            {
                                listener.onRoomMessage(messageSent.message);
                            }
                        }
                        else
                        {
                            foreach (IMListener listener in IMListeners)
                            {
                                listener.onIMMessage(messageSent.message);
                            }
                        }
                        break;

                    case "INSTANTMESSAGECREATED":

                        foreach (IMListener listeners in IMListeners)
                        {
                            listeners.onIMCreated(eventv4.payload.instantMessageCreated.stream);
                        }
                        break;

                    case "ROOMCREATED":

                        foreach (RoomListener listener in roomListeners)
                        {
                            listener.onRoomCreated(eventv4.payload.roomCreated);
                        }
                        break;

                    case "ROOMUPDATED":

                        foreach (RoomListener listener in roomListeners)
                        {
                            listener.onRoomUpdated(eventv4.payload.roomUpdated);
                        }
                        break;

                    case "ROOMDEACTIVATED":

                        foreach (RoomListener listener in roomListeners)
                        {
                            listener.onRoomDeactivated(eventv4.payload.roomDeactivated);
                        }
                        break;

                    case "ROOMREACTIVATED":

                        foreach (RoomListener listener in roomListeners)
                        {
                            listener.onRoomReactivated(eventv4.payload.roomReactivated.stream);
                        }
                        break;

                    case "USERJOINEDROOM":

                        foreach (RoomListener listener in roomListeners)
                        {
                            listener.onUserJoinedRoom(eventv4.payload.userJoinedRoom);
                        }
                        break;

                    case "USERLEFTROOM":

                        foreach (RoomListener listener in roomListeners)
                        {
                            listener.onUserLeftRoom(eventv4.payload.userLeftRoom);
                        }
                        break;

                    case "ROOMMEMBERPROMOTEDTOOWNER":

                        foreach (RoomListener listener in roomListeners)
                        {
                            listener.onRoomMemberPromotedToOwner(eventv4.payload.roomMemberPromotedToOwner);
                        }
                        break;

                    case "ROOMMEMBERDEMOTEDFROMOWNER":

                        foreach (RoomListener listener in roomListeners)
                        {
                            listener.onRoomMemberDemotedFromOwner(eventv4.payload.roomMemberDemotedFromOwner);
                        }
                        break;

                    case "CONNECTIONACCEPTED":

                        foreach (ConnectionListener listener in connectionListeners)
                        {
                            listener.onConnectionAccepted(eventv4.payload.connectionAccepted.fromUser);
                        }
                        break;

                    case "CONNECTIONREQUESTED":

                        foreach (ConnectionListener listener in connectionListeners)
                        {
                            listener.onConnectionRequested(eventv4.payload.connectionRequested.toUser);
                        }
                        break;

                    case "SYMPHONYELEMENTSACTION":
                        var StreamID = eventv4.payload.symphonyElementsAction.formStream.streamId.ToString();
                        StreamID = StreamID.Replace("=", "");
                        StreamID = StreamID.Replace("/", "_");
                        StreamID = StreamID.Replace("+", "-");

                        SymphonyElementsAction symphonyElementsAction = eventv4.payload.symphonyElementsAction;
                        User user = eventv4.initiator.user;
                        foreach (ElementsActionListener listener in elementsActionListeners)
                        {
                            listener.onFormMessage(user, StreamID, symphonyElementsAction);
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
        }
 public virtual void onElementsAction(User initiator, SymphonyElementsAction action)
 {
 }