notification.go (2240B)
1 // GoToSocial 2 // Copyright (C) GoToSocial Authors admin@gotosocial.org 3 // SPDX-License-Identifier: AGPL-3.0-or-later 4 // 5 // This program is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Affero General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Affero General Public License for more details. 14 // 15 // You should have received a copy of the GNU Affero General Public License 16 // along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 package model 19 20 // Notification represents a notification of an event relevant to the user. 21 // 22 // swagger:model notification 23 type Notification struct { 24 // REQUIRED 25 26 // The id of the notification in the database. 27 ID string `json:"id"` 28 // The type of event that resulted in the notification. 29 // follow = Someone followed you 30 // follow_request = Someone requested to follow you 31 // mention = Someone mentioned you in their status 32 // reblog = Someone boosted one of your statuses 33 // favourite = Someone favourited one of your statuses 34 // poll = A poll you have voted in or created has ended 35 // status = Someone you enabled notifications for has posted a status 36 Type string `json:"type"` 37 // The timestamp of the notification (ISO 8601 Datetime) 38 CreatedAt string `json:"created_at"` 39 // The account that performed the action that generated the notification. 40 Account *Account `json:"account"` 41 42 // OPTIONAL 43 44 // Status that was the object of the notification, e.g. in mentions, reblogs, favourites, or polls. 45 Status *Status `json:"status,omitempty"` 46 } 47 48 /* 49 The below functions are added onto the apimodel notification so that it satisfies 50 the Timelineable interface in internal/timeline. 51 */ 52 53 func (n *Notification) GetID() string { 54 return n.ID 55 } 56 57 func (n *Notification) GetAccountID() string { 58 return "" 59 } 60 61 func (n *Notification) GetBoostOfID() string { 62 return "" 63 } 64 65 func (n *Notification) GetBoostOfAccountID() string { 66 return "" 67 }