Remove chat groups

This commit is contained in:
Jm Casler 2022-02-24 20:05:27 -08:00
parent cd9def6850
commit b6d7eadea3
4 changed files with 2 additions and 111 deletions

View File

@ -140,16 +140,9 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
myNodeInfo.has_gps = gps && gps->isConnected(); // Update with latest GPS connect info
fromRadioScratch.which_payloadVariant = FromRadio_my_info_tag;
fromRadioScratch.my_info = myNodeInfo;
state = STATE_SEND_GROUPS;
service.refreshMyNodeInfo(); // Update my NodeInfo because the client will be asking for it soon.
break;
case STATE_SEND_GROUPS:
fromRadioScratch.which_payloadVariant = FromRadio_groups_tag;
fromRadioScratch.groups = ourGroupInfo;
state = STATE_SEND_NODEINFO;
service.refreshMyNodeInfo(); // Update my NodeInfo because the client will be asking for it soon.
break;
case STATE_SEND_NODEINFO: {
@ -228,9 +221,6 @@ bool PhoneAPI::available()
case STATE_SEND_MY_INFO:
return true;
case STATE_SEND_GROUPS:
return true;
case STATE_SEND_NODEINFO:
if (!nodeInfoForPhone)
nodeInfoForPhone = nodeDB.readNextInfo();

View File

@ -1,68 +0,0 @@
#include "GroupPlugin.h"
#include "MeshService.h"
#include "Router.h"
#include "configuration.h"
#include "NodeDB.h"
GroupPlugin *groupPlugin;
GroupPlugin::GroupPlugin()
: ProtobufPlugin("group", PortNum_GROUP_APP, GroupInfo_fields), concurrency::OSThread("GroupPlugin")
{
strcpy(ourGroupInfo.group[0], "Avocado");
strcpy(ourGroupInfo.group[1], "Backberries");
strcpy(ourGroupInfo.group[2], "Cantaloupe");
strcpy(ourGroupInfo.group[3], "Durian");
strcpy(ourGroupInfo.group[4], "Elderberry");
strcpy(ourGroupInfo.group[5], "Fig");
strcpy(ourGroupInfo.group[6], "Guava");
strcpy(ourGroupInfo.group[7], "Honeydew");
strcpy(ourGroupInfo.group[8], "Jackfruit");
strcpy(ourGroupInfo.group[9], "Kiwifruit");
}
bool GroupPlugin::handleReceivedProtobuf(const MeshPacket &mp, GroupInfo *pptr)
{
//auto p = *pptr;
return false; // Let others look at this message also if they want
}
MeshPacket *GroupPlugin::allocReply()
{
GroupInfo gi = GroupInfo_init_default; // Start with an empty structure
return allocDataProtobuf(gi);
}
int32_t GroupPlugin::runOnce()
{
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
DEBUG_MSG("Group 0=%s\n", ourGroupInfo.group[0]);
DEBUG_MSG("Group 1=%s\n", ourGroupInfo.group[1]);
DEBUG_MSG("Group 2=%s\n", ourGroupInfo.group[2]);
DEBUG_MSG("Group 3=%s\n", ourGroupInfo.group[3]);
DEBUG_MSG("Group 4=%s\n", ourGroupInfo.group[4]);
DEBUG_MSG("Group 5=%s\n", ourGroupInfo.group[5]);
DEBUG_MSG("Group 6=%s\n", ourGroupInfo.group[6]);
DEBUG_MSG("Group 7=%s\n", ourGroupInfo.group[7]);
DEBUG_MSG("Group 8=%s\n", ourGroupInfo.group[8]);
DEBUG_MSG("Group 9=%s\n", ourGroupInfo.group[9]);
DEBUG_MSG("Group 10=%s\n", ourGroupInfo.group[10]);
DEBUG_MSG("Group 11=%s\n", ourGroupInfo.group[11]);
DEBUG_MSG("group plugin runOnce()\n");
return 50000; // to save power only wake for our callback occasionally
}

View File

@ -1,29 +0,0 @@
#pragma once
#include "GroupPlugin.h"
#include "ProtobufPlugin.h"
#include "concurrency/OSThread.h"
/**
* Position plugin for sending/receiving positions into the mesh
*/
class GroupPlugin : public ProtobufPlugin<GroupInfo>, private concurrency::OSThread
{
public:
GroupPlugin();
protected:
/** Called to handle a particular incoming message
@return true if you've guaranteed you've handled this message and no other handlers should be considered for it
*/
virtual bool handleReceivedProtobuf(const MeshPacket &mp, GroupInfo *p) override;
/** Messages can be received that have the want_response bit set. If set, this callback will be invoked
* so that subclasses can (optionally) send a response back to the original sender. */
virtual MeshPacket *allocReply() override;
/** Does our periodic broadcast */
virtual int32_t runOnce() override;
};
extern GroupPlugin *groupPlugin;

View File

@ -4,7 +4,6 @@
#include "plugins/AdminPlugin.h"
#include "plugins/CannedMessagePlugin.h"
#include "plugins/ExternalNotificationPlugin.h"
#include "plugins/GroupPlugin.h"
#include "plugins/NodeInfoPlugin.h"
#include "plugins/PositionPlugin.h"
#include "plugins/RemoteHardwarePlugin.h"
@ -30,8 +29,7 @@ void setupPlugins()
nodeInfoPlugin = new NodeInfoPlugin();
positionPlugin = new PositionPlugin();
textMessagePlugin = new TextMessagePlugin();
groupPlugin = new GroupPlugin();
// Note: if the rest of meshtastic doesn't need to explicitly use your plugin, you do not need to assign the instance
// to a global variable.