Skip to content

Commit

Permalink
desktop/notification: stay compatble with go < 1.13
Browse files Browse the repository at this point in the history
time.Duration.Milliseconds was added in go 1.13, and has a trivial
implementation. Replicate that implementation instead of depending on
it.

Ref: https://go-review.googlesource.com/c/go/+/167387/2/src/time/time.go
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
  • Loading branch information
zyga committed Sep 30, 2020
1 parent 9c450cb commit d95132f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion desktop/notification/fdo.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (srv *Server) SendNotification(msg *Message) (ID, error) {
call := srv.obj.Call(dBusInterfaceName+".Notify", 0,
msg.AppName, msg.ReplacesID, msg.Icon, msg.Summary, msg.Body,
flattenActions(msg.Actions), mapHints(msg.Hints),
int32(msg.ExpireTimeout.Milliseconds()))
int32(msg.ExpireTimeout.Nanoseconds()/1e6))
var id ID
if err := call.Store(&id); err != nil {
return 0, err
Expand Down

0 comments on commit d95132f

Please sign in to comment.