Debian Codegraph @

modules/scripting/perl/api/channelregistration.xs

raw
1 MODULE = Atheme PACKAGE = Atheme::ChannelRegistration
2
3 Atheme_ChannelRegistration
4 find(SV * package, const char * name)
5 CODE:
6 RETVAL = mychan_find(name);
7 OUTPUT:
8 RETVAL
9
10 const char *
11 name(Atheme_ChannelRegistration self)
12 CODE:
13 RETVAL = self->name;
14 OUTPUT:
15 RETVAL
16
17 Atheme_Channel
18 chan(Atheme_ChannelRegistration self)
19 CODE:
20 RETVAL = self->chan;
21 OUTPUT:
22 RETVAL
23
24 Atheme_Internal_List
25 chanacs(Atheme_ChannelRegistration self)
26 CODE:
27 RETVAL = perl_list_create(&self->chanacs, "Atheme::ChanAcs");
28 OUTPUT:
29 RETVAL
30
31 void
32 drop(Atheme_ChannelRegistration self)
33 CODE:
34 hook_call_channel_drop (self);
35
36 if (self->chan != NULL && !(self->chan->flags & CHAN_LOG)) {
37 part (self->name, chansvs.nick);
38 }
39
40 object_unref (self);
41
42 void
43 transfer (Atheme_ChannelRegistration self, Atheme_Sourceinfo si, Atheme_Entity user)
44 CODE:
45 mowgli_node_t *n;
46
47 chanacs_t *ca;
48
49 MOWGLI_ITER_FOREACH(n, self->chanacs.head)
50 {
51 ca = n->data;
52 if (ca->entity != NULL && ca->level & CA_FOUNDER)
53 chanacs_modify_simple(ca, CA_FLAGS, CA_FOUNDER);
54 }
55
56 self->used = CURRTIME;
57 chanacs_change_simple(self, user, NULL, CA_FOUNDER_0, 0, entity(si->smu));
58
59 metadata_delete(self, "private:verify:founderchg:newfounder");
60 metadata_delete(self, "private:verify:founderchg:timestamp");
61
62 time_t
63 used_time (Atheme_ChannelRegistration self)
64 CODE:
65 RETVAL = self->used;
66 OUTPUT:
67 RETVAL
68
69 unsigned int
70 flags (Atheme_ChannelRegistration self, unsigned int newflags = 0)
71 CODE:
72 if (items > 1)
73 self->flags = newflags;
74 RETVAL = self->flags;
75 OUTPUT:
76 RETVAL
77
78 MODULE = Atheme PACKAGE = Atheme::ChanAcs
79
80 Atheme_ChannelRegistration
81 channel(Atheme_ChanAcs self)
82 CODE:
83 RETVAL = self->mychan;
84 OUTPUT:
85 RETVAL
86
87 Atheme_Entity
88 entity(Atheme_ChanAcs self)
89 CODE:
90 RETVAL = self->entity;
91 OUTPUT:
92 RETVAL
93
94 Atheme_Account
95 user(Atheme_ChanAcs self)
96 CODE:
97 if (!self->entity || self->entity->type != ENT_USER)
98 RETVAL = NULL;
99 else
100 RETVAL = (Atheme_Account)self->entity;
101 OUTPUT:
102 RETVAL
103
104 const char *
105 hostmask(Atheme_ChanAcs self)
106 CODE:
107 RETVAL = self->host;
108 OUTPUT:
109 RETVAL
110
111 const char *
112 namestr(Atheme_ChanAcs self)
113 CODE:
114 if (self->entity)
115 RETVAL = self->entity->name;
116 else
117 RETVAL = self->host;
118 OUTPUT:
119 RETVAL
120
121 unsigned int
122 flags(Atheme_ChanAcs self)
123 CODE:
124 RETVAL = self->level;
125 OUTPUT:
126 RETVAL
127
128 const char *
129 flagstr(Atheme_ChanAcs self)
130 CODE:
131 RETVAL = bitmask_to_flags(self->level);
132 OUTPUT:
133 RETVAL
134
135 time_t
136 modified(Atheme_ChanAcs self)
137 CODE:
138 RETVAL = self->tmodified;
139 OUTPUT:
140 RETVAL
141
142 const char *
143 datestr(Atheme_ChanAcs self)
144 CODE:
145 RETVAL = time_ago(self->tmodified);
146 OUTPUT:
147 RETVAL
148