diff --git a/dev.deedles.Trayscale.metainfo.xml b/dev.deedles.Trayscale.metainfo.xml
index fbc417c..ec53d4d 100644
--- a/dev.deedles.Trayscale.metainfo.xml
+++ b/dev.deedles.Trayscale.metainfo.xml
@@ -54,6 +54,12 @@
+
+
+
+ Skip polling for waiting files if Taildrop isn't turned on.
+
+
diff --git a/internal/tray/tray.go b/internal/tray/tray.go
index d56392e..713147b 100644
--- a/internal/tray/tray.go
+++ b/internal/tray/tray.go
@@ -34,11 +34,11 @@ func New(online bool) *Tray {
systray.SetIcon(statusIcon(online))
systray.SetTitle("Trayscale")
+ showWindow := systray.AddMenuItem("Show", "")
+ systray.AddSeparator()
connToggleItem := systray.AddMenuItem(connToggleText(online), "")
selfNodeItem := systray.AddMenuItem("", "")
systray.AddSeparator()
- showWindow := systray.AddMenuItem("Show", "")
- systray.AddSeparator()
quit := systray.AddMenuItem("Quit", "")
return &Tray{
diff --git a/internal/tsutil/poller.go b/internal/tsutil/poller.go
index e4093f0..7bf51ca 100644
--- a/internal/tsutil/poller.go
+++ b/internal/tsutil/poller.go
@@ -13,6 +13,7 @@ import (
"tailscale.com/client/tailscale/apitype"
"tailscale.com/ipn"
"tailscale.com/ipn/ipnstate"
+ "tailscale.com/tailcfg"
)
// A Poller gets the latest Tailscale status at regular intervals or
@@ -81,12 +82,15 @@ func (p *Poller) Run(ctx context.Context) {
continue
}
- files, err := WaitingFiles(ctx)
- if err != nil {
- if ctx.Err() != nil {
- return
+ var files []apitype.WaitingFile
+ if status.Self.HasCap(tailcfg.CapabilityFileSharing) {
+ files, err = WaitingFiles(ctx)
+ if err != nil {
+ if ctx.Err() != nil {
+ return
+ }
+ slog.Error("get waiting files", "err", err)
}
- slog.Error("get waiting files", "err", err)
}
s := Status{Status: status, Prefs: prefs, Files: files}
diff --git a/internal/tsutil/tsutil.go b/internal/tsutil/tsutil.go
index 7c10912..462223d 100644
--- a/internal/tsutil/tsutil.go
+++ b/internal/tsutil/tsutil.go
@@ -39,7 +39,7 @@ func IsMullvad(peer *ipnstate.PeerStatus) bool {
// CanMullvad returns true if peer is allowed to access Mullvad exit
// nodes.
func CanMullvad(peer *ipnstate.PeerStatus) bool {
- return peer.CapMap.Contains("mullvad")
+ return peer.HasCap("mullvad")
}
// CompareLocations alphabestically compares the countries and then,