Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
Remove my own TODO: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jezek committed Apr 25, 2021
1 parent 2034f96 commit 188581a
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 28 deletions.
4 changes: 0 additions & 4 deletions cmd/nuntium/mediator.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ func (mediator *Mediator) handleMNotificationInd(mNotificationInd *mms.MNotifica
log.Println("Error updating storage (UpdateResponded): ", err)
return
}
//TODO:jezek - Add storage states to docs graph file docs/assets/receiving_success_deferral_disabled.msc
}

// Communicates the download error "err" of mNotificationInd to telepathy service.
Expand Down Expand Up @@ -524,8 +523,6 @@ func (mediator *Mediator) handleOutgoingMessage(msg *telepathy.OutgoingMessage)

func (mediator *Mediator) handleMSendReq(mSendReq *mms.MSendReq) {
log.Print("Encoding M-Send.Req")
//TODO:issue - storage is created, but it seems it is not deleted anywhere. Ensure deletion.
//TODO:issue - on initialize, handle undeleted send messages (also add modem id and on init delete old stored messages).
f, err := storage.CreateSendFile(mSendReq.UUID)
if err != nil {
log.Print("Unable to create m-send.req file for ", mSendReq.UUID)
Expand Down Expand Up @@ -886,7 +883,6 @@ func (mediator *Mediator) respondMessage(mmsState storage.MMSState) error {
mediator.contextLock.Lock()
defer mediator.contextLock.Unlock()

//TODO:issue - check if data enabled and if not, return error.
mRetrieveConf, err := mediator.getMRetrieveConf(mmsState.MNotificationInd.UUID)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
TODO:jezek - fill changes
nuntium (1.4+ubports1) xenial; urgency=medium

* Imported to UBports
Expand Down
6 changes: 2 additions & 4 deletions mms/mms.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,8 @@ type MNotificationInd struct {
ReplyChargingId string
TransactionId, ContentLocation string
From, Subject string
//TODO:version - change back to unit64 to increase only minor version instead of major (Received could be also uint64)?
Expiry time.Time
Size uint64
Expiry time.Time
Size uint64
}

// MNotifyRespInd holds a m-notifyresp.ind message defined in
Expand Down Expand Up @@ -304,7 +303,6 @@ func NewMSendConf() *MSendConf {
}
}

//TODO:version - change back to NewMNotificationInd() to increase only minor version instead of major (add Received after every NewMNotificationInd)?
func NewMNotificationInd(received time.Time) *MNotificationInd {
return &MNotificationInd{Type: TYPE_NOTIFICATION_IND, UUID: GenUUID(), Received: received}
}
Expand Down
1 change: 0 additions & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (

const SUBPATH = "nuntium/store"

//TODO:version - change back to Create(uuid, contentLocation string) to increase only minor version instead of major (add ModemId, MNotificationInd after every Create)?
// Creates an .db file in storage with message state stored.
// Returns an empty state and not nil error if message not stored successfully.
func Create(modemId string, mNotificationInd *mms.MNotificationInd) (MMSState, error) {
Expand Down
1 change: 0 additions & 1 deletion telepathy/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func (manager *MMSManager) serviceAdded(payload *Payload) error {
return nil
}

//TODO:version - Change so we don't need to bump major version.
func (manager *MMSManager) AddService(identity string, modemObjPath dbus.ObjectPath, outgoingChannel chan *OutgoingMessage, useDeliveryReports bool, mNotificationIndChan chan<- *mms.MNotificationInd) (*MMSService, error) {
for i := range manager.services {
if manager.services[i].isService(identity) {
Expand Down
5 changes: 0 additions & 5 deletions telepathy/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type MessageInterface struct {
status string
}

//TODO:version - Change so we don't need to bump major version.
func NewMessageInterface(conn *dbus.Connection, objectPath dbus.ObjectPath, deleteChan chan dbus.ObjectPath, redownloadChan chan dbus.ObjectPath) *MessageInterface {
msgInterface := MessageInterface{
conn: conn,
Expand All @@ -71,7 +70,6 @@ func (msgInterface *MessageInterface) watchDBusMethodCalls() {
defer log.Printf("jezek - msgInterface %v: watchDBusMethodCalls(): end", msgInterface.objectPath)
var reply *dbus.Message

//TODO:issue - Expire interface listeners if failed download error and message expires at MMS provider.
for msg := range msgInterface.msgChan {
log.Printf("jezek - msgInterface %v: Received message: %v", msgInterface.objectPath, msg)
if msg.Interface != MMS_MESSAGE_DBUS_IFACE {
Expand All @@ -88,9 +86,6 @@ func (msgInterface *MessageInterface) watchDBusMethodCalls() {
}
switch msg.Member {
case "Delete":
//TODO:issue - on some occasions (nuntium crash & restart) the telephony-service (or smthg. else) sends multiple read/delete requests. This crashes nuntium, when on first delete closing chanel whilst second del. req. is waiting in cannel.
//TODO:issue - Here is telepaty-ofono registering MMSD service, try to check if already added and just call getmessages if yes. https://github.com/ubports/telepathy-ofono/blob/040321101e7bfe5950934a1b718875f3fe29c495/connection.cpp#L341

reply = dbus.NewMethodReturnMessage(msg)
//TODO implement store and forward
if err := msgInterface.conn.Send(reply); err != nil {
Expand Down
13 changes: 0 additions & 13 deletions telepathy/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ type OutgoingMessage struct {
Reply *dbus.Message
}

//TODO:version - Change so we don't need to bump major version.
func NewMMSService(conn *dbus.Connection, modemObjPath dbus.ObjectPath, identity string, outgoingChannel chan *OutgoingMessage, useDeliveryReports bool, mNotificationIndChan chan<- *mms.MNotificationInd) *MMSService {
properties := make(map[string]dbus.Variant)
properties[identityProperty] = dbus.Variant{identity}
Expand Down Expand Up @@ -342,7 +341,6 @@ func (service *MMSService) SingnalMessageRemoved(objectPath dbus.ObjectPath) err
return nil
}

//TODO:version - Change so we don't need to bump major version.
func (service *MMSService) IncomingMessageFailAdded(mNotificationInd *mms.MNotificationInd, downloadError error) error {
if service == nil {
return fmt.Errorf("Nil MMSService")
Expand All @@ -356,14 +354,6 @@ func (service *MMSService) IncomingMessageFailAdded(mNotificationInd *mms.MNotif

params := make(map[string]dbus.Variant)

//TODO:jezek - delete or write somewhere
// Signal path:
// https://github.com/ubports/telepathy-ofono/blob/040321101e7bfe5950934a1b718875f3fe29c495/mmsdservice.cpp#L118
// https://github.com/ubports/telepathy-ofono/blob/040321101e7bfe5950934a1b718875f3fe29c495/connection.cpp#L518
// https://github.com/ubports/telepathy-ofono/blob/040321101e7bfe5950934a1b718875f3fe29c495/connection.cpp#L423
// https://github.com/ubports/telepathy-ofono/blob/db5e35b68f244d007468b8de2d9ad9998a2c8bd7/ofonotextchannel.cpp#L473
// https://github.com/TelepathyIM/telepathy-qt/blob/7cf3e35fdf6cf7ea7d8fc301eae04fe43930b17f/TelepathyQt/base-channel.cpp#L460
// https://github.com/ubports/history-service/blob/8285a4a3174b84a04f00d600fff99905aec6c4e2/daemon/historydaemon.cpp#L1023
params["Status"] = dbus.Variant{"received"}
params["Date"] = dbus.Variant{time.Now().Format(time.RFC3339)}
params["Sender"] = dbus.Variant{strings.TrimSuffix(mNotificationInd.From, PLMN)}
Expand Down Expand Up @@ -424,11 +414,9 @@ func (service *MMSService) IncomingMessageFailAdded(mNotificationInd *mms.MNotif
redownloadChan = nil
}
service.messageHandlers[payload.Path] = NewMessageInterface(service.conn, payload.Path, service.msgDeleteChan, redownloadChan)
//TODO:issue - if error encountered, you can stop handling message.
return service.MessageAdded(&payload)
}

//TODO:version - Change so we don't need to bump major version.
//IncomingMessageAdded emits a MessageAdded with the path to the added message which
//is taken as a parameter and creates an object path on the message interface.
func (service *MMSService) IncomingMessageAdded(mRetConf *mms.MRetrieveConf, mNotificationInd *mms.MNotificationInd) error {
Expand All @@ -455,7 +443,6 @@ func (service *MMSService) IncomingMessageAdded(mRetConf *mms.MRetrieveConf, mNo
}

service.messageHandlers[payload.Path] = NewMessageInterface(service.conn, payload.Path, service.msgDeleteChan, nil)
//TODO:issue - if error encountered, you can stop handling message.
return service.MessageAdded(&payload)
}

Expand Down

0 comments on commit 188581a

Please sign in to comment.