@@ -174,8 +174,13 @@ private void initializeRecyclerView(final Context ctx) {
174174 menu .add (0 , v .getId (), 4 , R .string .ping_source );
175175 menu .add (0 , v .getId (), 5 , R .string .resolve_destination );
176176 menu .add (0 , v .getId (), 6 , R .string .resolve_source );
177- menu .add (0 , v .getId (), 9 , "Block this destination permanently" );
178- menu .add (0 , v .getId (), 10 , "Whitelist this destination" );
177+ // Only show Copy Domain if a hostname was resolved
178+ String hostname = current_selected_logData .getHostname ();
179+ if (hostname != null && !hostname .trim ().isEmpty () && !hostname .equals (current_selected_logData .getDst ())) {
180+ menu .add (0 , v .getId (), 9 , R .string .copy_domain );
181+ }
182+ menu .add (0 , v .getId (), 10 , "Block this destination permanently" );
183+ menu .add (0 , v .getId (), 11 , "Whitelist this destination" );
179184 LogPreference logPreference = SQLite .select ()
180185 .from (LogPreference .class )
181186 .where (LogPreference_Table .uid .eq (uid )).querySingle ();
@@ -266,10 +271,19 @@ public boolean onContextItemSelected(MenuItem item) {
266271 case 8 :
267272 G .updateLogNotification (uid , true );
268273 break ;
269- case 9 : // Block destination permanently
274+ case 9 : // Copy Domain
275+ String domain = current_selected_logData .getHostname ();
276+ if (domain != null && !domain .trim ().isEmpty () && !domain .equals (current_selected_logData .getDst ())) {
277+ Api .copyToClipboard (LogDetailActivity .this , domain );
278+ Api .toast (LogDetailActivity .this , getString (R .string .domain_copied ));
279+ } else {
280+ Api .toast (LogDetailActivity .this , getString (R .string .no_domain_resolved ));
281+ }
282+ break ;
283+ case 10 : // Block destination permanently
270284 showBlockDestinationDialog ();
271285 break ;
272- case 10 : // Whitelist destination
286+ case 11 : // Whitelist destination
273287 showWhitelistDestinationDialog ();
274288 break ;
275289
0 commit comments