Skip to content

[WIP] Add function to auto create #wardriving channel if missing#55

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/add-auto-create-wardriving-channel
Closed

[WIP] Add function to auto create #wardriving channel if missing#55
Copilot wants to merge 1 commit intomainfrom
copilot/add-auto-create-wardriving-channel

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

Id like you help add a function that lets the app auto create the #wardriving channel if it dosnt exist. Its based on the public channels key and I dont think it should be to diffiult. Here is how the original dev did it but I think hes joining a private wardriving channel note a public

// --- Wardrive channel ---
async function createWardriveChannel() {
  const create = window.confirm(
    `Channel "${wardriveChannelName}" not found on this device. Create it now?`
  );

  if (!create) {
    throw new Error("Wardrive channel not found");
  }

  // Find a free channel index.
  const channels = await state.connection.getChannels();
  let idx = 0;
  while (idx < channels.length) {
    if (channels[idx].name === '')
      break;
    ++idx;
  }

  if (idx >= channels.length) {
    throw new Error("No free channel slots available");
  }

  // Derived secret for #wardrive 4076c315c1ef385fa93f066027320fe5
  const wardriveKey = new Uint8Array([
    0x40, 0x76, 0xC3, 0x15, 0xC1, 0xEF, 0x38, 0x5F,
    0xA9, 0x3F, 0x06, 0x60, 0x27, 0x32, 0x0F, 0xE5
  ]);

  // Create and set the connection.
  const channel = { channelIdx: idx, name: wardriveChannelName, wardriveKey };
  await state.connection.setChannel(idx, wardriveChannelName, wardriveKey);
  return channel;
}

Some other repos that may help understand how to join a public hashtag channel
https://github.com/meshcore-dev/MeshCore
https://github.com/meshcore-dev/meshcore-ha
https://github.com/meshcore-dev/meshcore-cli
https://github.com/meshcore-dev/meshcore_py
https://github.com/meshcore-dev/meshcore.js


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 19, 2025
@MrAlders0n
Copy link
Collaborator

Did it a different way

@MrAlders0n MrAlders0n reopened this Dec 19, 2025
@MrAlders0n MrAlders0n closed this Dec 19, 2025
@MrAlders0n MrAlders0n deleted the copilot/add-auto-create-wardriving-channel branch December 22, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants