From aa0dd020cee882e218c9ab9eb6b75f142abfd8d5 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Tue, 27 Nov 2018 22:39:17 -0500 Subject: group chat invite accepted message. --- src/Data/Tox/Msg.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Data') diff --git a/src/Data/Tox/Msg.hs b/src/Data/Tox/Msg.hs index e8c26a56..6550fd95 100644 --- a/src/Data/Tox/Msg.hs +++ b/src/Data/Tox/Msg.hs @@ -261,14 +261,14 @@ instance Show ChatID where show (ChatID ed) = showToken32 ed data InviteType = GroupInvite { groupName :: Text } - | AccptedInvite + | AcceptedInvite | ConfirmedInvite { inviteNodes :: [NodeInfo] } deriving (Eq,Show) instance Sized InviteType where size = VarSize $ \x -> case x of GroupInvite name -> B.length (T.encodeUtf8 name) - AccptedInvite -> 0 + AcceptedInvite -> 0 ConfirmedInvite ns -> 0 -- TODO: size of node list. data Invite = Invite @@ -292,20 +292,20 @@ instance Serialize Invite where Invite chatid chatkey <$> case invite_type of 0 -> do bs <- remaining >>= getBytes -- TODO: size can be determined from group shared state. return $ GroupInvite $ decodeUtf8 bs - 1 -> return AccptedInvite + 1 -> return AcceptedInvite 2 -> return $ ConfirmedInvite [] -- TODO: decode nodes put x = do putWord8 254 -- GP_FRIEND_INVITE putWord8 $ case invite x of GroupInvite {} -> 0 -- GROUP_INVITE - AccptedInvite -> 1 -- GROUP_INVITE_ACCEPTED + AcceptedInvite -> 1 -- GROUP_INVITE_ACCEPTED ConfirmedInvite {} -> 2 -- GROUP_INVITE_CONFIRMATION put $ inviteChatID x put $ key2id $ inviteChatKey x case invite x of GroupInvite name -> putByteString $ encodeUtf8 name - AccptedInvite -> return () + AcceptedInvite -> return () ConfirmedInvite ns -> return () -- TODO: encode nodes. instance Packet Invite where -- cgit v1.2.3