Skip to content
Snippets Groups Projects
Select Git revision
  • 29ec69c2cee6bb78f1faef0d8ab4f8039fbc41ad
  • 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

client.go

Blame
  • notifications.go 2.18 KiB
    ///////////////////////////////////////////////////////////////////////////////
    // Copyright © 2020 xx network SEZC                                          //
    //                                                                           //
    // Use of this source code is governed by a license that can be found in the //
    // LICENSE file                                                              //
    ///////////////////////////////////////////////////////////////////////////////
    
    package api
    
    import jww "github.com/spf13/jwalterweatherman"
    
    // RegisterForNotifications allows a client to register for push
    // notifications.
    // Note that clients are not required to register for push notifications
    // especially as these rely on third parties (i.e., Firebase *cough*
    // *cough* google's palantir *cough*) that may represent a security
    // risk to the user.
    func (c *Client) RegisterForNotifications(token []byte) error {
    	jww.INFO.Printf("RegisterForNotifications(%s)", token)
    	// // Pull the host from the manage
    	// notificationBotHost, ok := cl.receptionManager.Comms.GetHost(&id.NotificationBot)
    	// if !ok {
    	// 	return errors.New("Failed to retrieve host for notification bot")
    	// }
    
    	// // Send the register message
    	// _, err := cl.receptionManager.Comms.RegisterForNotifications(notificationBotHost,
    	// 	&mixmessages.NotificationToken{
    	// 		Token: notificationToken,
    	// 	})
    	// if err != nil {
    	// 	err := errors.Errorf(
    	// 		"RegisterForNotifications: Unable to register for notifications! %s", err)
    	// 	return err
    	// }
    
    	return nil
    }
    
    // UnregisterForNotifications turns of notifications for this client
    func (c *Client) UnregisterForNotifications() error {
    	jww.INFO.Printf("UnregisterForNotifications()")
    	// // Pull the host from the manage
    	// notificationBotHost, ok := cl.receptionManager.Comms.GetHost(&id.NotificationBot)
    	// if !ok {
    	// 	return errors.New("Failed to retrieve host for notification bot")
    	// }
    
    	// // Send the unregister message
    	// _, err := cl.receptionManager.Comms.UnregisterForNotifications(notificationBotHost)
    	// if err != nil {
    	// 	err := errors.Errorf(
    	// 		"RegisterForNotifications: Unable to register for notifications! %s", err)
    	// 	return err
    	// }
    
    	return nil
    }