Skip to content
Snippets Groups Projects
Select Git revision
  • 9caf0b14a5c0397f56d1e061987bcf11799e0ccb
  • release default protected
  • 11-22-implement-kv-interface-defined-in-collectiveversionedkvgo
  • hotfix/TestHostPool_UpdateNdf_AddFilter
  • XX-4719/announcementChannels
  • xx-4717/logLevel
  • jonah/noob-channel
  • master protected
  • XX-4707/tagDiskJson
  • xx-4698/notification-retry
  • hotfix/notifylockup
  • syncNodes
  • hotfix/localCB
  • XX-4677/NewChanManagerMobile
  • XX-4689/DmSync
  • duplicatePrefix
  • XX-4601/HavenInvites
  • finalizedUICallbacks
  • XX-4673/AdminKeySync
  • debugNotifID
  • anne/test
  • v4.7.5
  • v4.7.4
  • v4.7.3
  • v4.7.2
  • v4.7.1
  • v4.6.3
  • v4.6.1
  • v4.5.0
  • v4.4.4
  • v4.3.11
  • v4.3.8
  • v4.3.7
  • v4.3.6
  • v4.3.5
  • v4.2.0
  • v4.3.0
  • v4.3.4
  • v4.3.3
  • v4.3.2
  • v4.3.1
41 results

ud.go

Blame
  • wrapper.go 2.10 KiB
    ////////////////////////////////////////////////////////////////////////////////
    // Copyright © 2022 xx foundation                                             //
    //                                                                            //
    // Use of this source code is governed by a license that can be found in the  //
    // LICENSE file.                                                              //
    ////////////////////////////////////////////////////////////////////////////////
    
    package groupChat
    
    import (
    	gs "gitlab.com/elixxir/client/groupChat/groupStore"
    	"gitlab.com/elixxir/crypto/group"
    	"gitlab.com/xx_network/primitives/id"
    	"time"
    )
    
    // Wrapper handles the sending and receiving of group chat using E2E
    // messages to inform the recipient of incoming group chat messages.
    type Wrapper struct {
    	gc GroupChat
    }
    
    // NewWrapper constructs a wrapper around the GroupChat interface.
    func NewWrapper(manager GroupChat) *Wrapper {
    	return &Wrapper{gc: manager}
    }
    
    // MakeGroup calls GroupChat.MakeGroup.
    func (w *Wrapper) MakeGroup(membership []*id.ID, name, message []byte) (
    	gs.Group, []id.Round, RequestStatus, error) {
    	return w.gc.MakeGroup(membership, name, message)
    }
    
    // GetGroup calls GroupChat.GetGroup.
    func (w *Wrapper) GetGroup(groupID *id.ID) (gs.Group, bool) {
    	return w.gc.GetGroup(groupID)
    }
    
    // ResendRequest calls GroupChat.ResendRequest.
    func (w *Wrapper) ResendRequest(groupID *id.ID) ([]id.Round, RequestStatus, error) {
    	return w.gc.ResendRequest(groupID)
    }
    
    // JoinGroup calls GroupChat.JoinGroup.
    func (w *Wrapper) JoinGroup(grp gs.Group) error {
    	return w.gc.JoinGroup(grp)
    }
    
    // LeaveGroup calls GroupChat.LeaveGroup.
    func (w *Wrapper) LeaveGroup(groupID *id.ID) error {
    	return w.gc.LeaveGroup(groupID)
    }
    
    // Send calls GroupChat.Send.
    func (w *Wrapper) Send(groupID *id.ID, message []byte, tag string) (
    	id.Round, time.Time, group.MessageID, error) {
    	return w.gc.Send(groupID, tag, message)
    }
    
    // GetGroups calls GroupChat.GetGroups.
    func (w *Wrapper) GetGroups() []*id.ID {
    	return w.gc.GetGroups()
    }
    
    // NumGroups calls GroupChat.NumGroups.
    func (w *Wrapper) NumGroups() int {
    	return w.gc.NumGroups()
    }