summaryrefslogtreecommitdiff
path: root/src/social/guest.h
blob: 6d268641a242d795cec5a20234f2df9ae3d586ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef GUEST_H
#define GUEST_H

#include <QObject>
#include "place.h"

class Guest : public Place
{

  Q_OBJECT;

 public:

  explicit
    Guest (GNUNET_SOCIAL_App *app,
           GNUNET_SOCIAL_Ego *ego,
           const GNUNET_CRYPTO_EddsaPublicKey *placePubKey,
           const GNUNET_PeerIdentity *origin,
           uint32_t relayCount = 0,
           const GNUNET_PeerIdentity *relays = NULL,
           const GNUNET_PSYC_Message *entryMsg = NULL,
           QObject *parent = NULL);

  explicit
    Guest (GNUNET_SOCIAL_App *app,
           GNUNET_SOCIAL_Ego *ego,
           GNUNET_SOCIAL_GuestConnection *gconn,
           QObject *parent = NULL);

  ~Guest ();

  Q_INVOKABLE void
    talk (QString text);

  void
    talkRequest (Message *msg);

  void
    talkRequest (QString text);

 signals:

  void
    talkRequestSignal (QString text);


 private:

  GNUNET_SOCIAL_Guest *m_guest;

  GNUNET_SOCIAL_TalkRequest *m_talk;

  void
    connectSignals ();

  static void
    recvEntryDecisionCallback (void *cls, int is_admitted,
                               const struct GNUNET_PSYC_Message
                               *entry_resp);

  static void
    recvLocalEnterCallback (void *cls, int result,
                            const struct GNUNET_CRYPTO_EddsaPublicKey *placePubKey,
                                           uint64_t max_message_id);
};

#endif