| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package WebService::Gitter; |
|
2
|
|
|
|
|
|
|
$WebService::Gitter::VERSION = '2.2.0'; |
|
3
|
|
|
|
|
|
|
#ABSTRACT: An interface to Gitter REST API via Perl 5. |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
11982
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
22
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use Moo; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
4
|
|
|
9
|
1
|
|
|
1
|
|
254
|
use Function::Parameters; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
4
|
|
|
10
|
|
|
|
|
|
|
with 'WebService::Client'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has api_key => ( |
|
13
|
|
|
|
|
|
|
is => 'ro', |
|
14
|
|
|
|
|
|
|
required => 1 |
|
15
|
|
|
|
|
|
|
); |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has '+base_url' => ( default => 'https://api.gitter.im/v1' ); |
|
18
|
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
0
|
1
|
|
method get_me() { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
return $self->get( "/user/me?access_token=" . $self->api_key ); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
0
|
1
|
|
method list_groups() { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return $self->get( "/groups?access_token=" . $self->api_key ); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
0
|
1
|
|
method rooms_under_group($group_id) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
return $self->get( |
|
32
|
|
|
|
|
|
|
"/groups/$group_id/rooms?access_token=" . $self->api_key ); |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
0
|
0
|
0
|
0
|
1
|
|
method rooms( : $q = '' ) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
return $self->get( "/rooms?access_token=" . $self->api_key . "&q=$q" ); |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
0
|
0
|
0
|
0
|
1
|
|
method room_from_uri( : $uri ) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return $self->post( "/rooms?access_token=" . $self->api_key, |
|
41
|
|
|
|
|
|
|
{ uri => $uri } ); |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
0
|
1
|
|
method join_room( $room_id, $user_id ) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return $self->post( "/user/$user_id/rooms?access_token=" . $self->api_key, |
|
46
|
|
|
|
|
|
|
{ id => $room_id } ); |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
0
|
0
|
|
0
|
1
|
|
method remove_user_from_room( $room_id, $user_id ) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $self->delete( |
|
51
|
|
|
|
|
|
|
"/rooms/$room_id/users/$user_id?access_token=" . $self->api_key ); |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
method update_room( $room_id, |
|
55
|
|
|
|
|
|
|
: $topic = '', |
|
56
|
|
|
|
|
|
|
: $noindex = 'false', |
|
57
|
|
|
|
|
|
|
: $tags = '' ) |
|
58
|
0
|
0
|
0
|
0
|
1
|
|
{ |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
return $self->put( |
|
60
|
|
|
|
|
|
|
"/rooms/$room_id?access_token=" . $self->api_key, |
|
61
|
|
|
|
|
|
|
{ topic => $topic, noindex => $noindex, tags => $tags } |
|
62
|
|
|
|
|
|
|
); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
0
|
0
|
|
0
|
1
|
|
method delete_room($room_id) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
return $self->delete( "/rooms/$room_id?access_token=" . $self->api_key ); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
0
|
0
|
0
|
0
|
1
|
|
method room_users( $room_id, : $q = '', : $skip = 0, : $limit = 30 ) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
70
|
0
|
0
|
|
|
|
|
return $self->get( "/rooms/$room_id/users?access_token=" |
|
71
|
|
|
|
|
|
|
. $self->api_key |
|
72
|
|
|
|
|
|
|
. "&skip=$skip" |
|
73
|
|
|
|
|
|
|
. "&limit=$limit" ) |
|
74
|
|
|
|
|
|
|
if not $q; |
|
75
|
|
|
|
|
|
|
|
|
76
|
0
|
0
|
|
|
|
|
return $self->get( "/rooms/$room_id/users?access_token=" |
|
77
|
|
|
|
|
|
|
. $self->api_key . "&q=$q" |
|
78
|
|
|
|
|
|
|
. "&skip=$skip" |
|
79
|
|
|
|
|
|
|
. "&limit=$limit" ) |
|
80
|
|
|
|
|
|
|
if $q; |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
method list_messages( |
|
84
|
|
|
|
|
|
|
$room_id, |
|
85
|
|
|
|
|
|
|
: $skip = 0, |
|
86
|
|
|
|
|
|
|
: $beforeId = '', |
|
87
|
|
|
|
|
|
|
: $afterId = '', |
|
88
|
|
|
|
|
|
|
: $aroundId = '', |
|
89
|
|
|
|
|
|
|
: $limit = 30, |
|
90
|
|
|
|
|
|
|
: $q = '' |
|
91
|
|
|
|
|
|
|
) |
|
92
|
0
|
0
|
0
|
0
|
1
|
|
{ |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
return $self->get( "/rooms/$room_id/chatMessages?access_token=" |
|
94
|
|
|
|
|
|
|
. $self->api_key |
|
95
|
|
|
|
|
|
|
. "&skip=$skip" |
|
96
|
|
|
|
|
|
|
. "&beforeId=$beforeId" |
|
97
|
|
|
|
|
|
|
. "&afterId=$afterId" |
|
98
|
|
|
|
|
|
|
. "&aroundId=$aroundId" |
|
99
|
|
|
|
|
|
|
. "&limit=$limit" |
|
100
|
|
|
|
|
|
|
. "&q=$q" ); |
|
101
|
|
|
|
|
|
|
} |
|
102
|
|
|
|
|
|
|
|
|
103
|
0
|
0
|
|
0
|
1
|
|
method single_message( $room_id, $message_id ) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
return $self->get( "/rooms/$room_id/chatMessages/$message_id" |
|
105
|
|
|
|
|
|
|
. "?access_token=" |
|
106
|
|
|
|
|
|
|
. $self->api_key ); |
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
|
|
109
|
0
|
0
|
0
|
0
|
1
|
|
method send_message( $room_id, : $text ) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
return $self->post( |
|
111
|
|
|
|
|
|
|
"/rooms/$room_id/chatMessages?access_token=" . $self->api_key, |
|
112
|
|
|
|
|
|
|
{ text => $text } ); |
|
113
|
|
|
|
|
|
|
} |
|
114
|
|
|
|
|
|
|
|
|
115
|
0
|
0
|
0
|
0
|
1
|
|
method update_message( $room_id, $message_id, : $text ) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
return $self->put( |
|
117
|
|
|
|
|
|
|
"/rooms/$room_id/chatMessages/$message_id?access_token=" |
|
118
|
|
|
|
|
|
|
. $self->api_key, |
|
119
|
|
|
|
|
|
|
{ text => $text } |
|
120
|
|
|
|
|
|
|
); |
|
121
|
|
|
|
|
|
|
} |
|
122
|
|
|
|
|
|
|
|
|
123
|
0
|
0
|
|
0
|
1
|
|
method unread_items( $user_id, $room_id ) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
124
|
0
|
|
|
|
|
|
return $self->get( |
|
125
|
|
|
|
|
|
|
"/user/$user_id/rooms/$room_id/unreadItems?access_token=" |
|
126
|
|
|
|
|
|
|
. $self->api_key ); |
|
127
|
|
|
|
|
|
|
} |
|
128
|
|
|
|
|
|
|
|
|
129
|
0
|
0
|
|
0
|
1
|
|
method mark_unread_items( $user_id, $room_id, @chat_ids ) { |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
return $self->post( |
|
131
|
|
|
|
|
|
|
"/user/$user_id/rooms/$room_id/unreadItems?access_token=" |
|
132
|
|
|
|
|
|
|
. $self->api_key, |
|
133
|
|
|
|
|
|
|
{ chat => @chat_ids } |
|
134
|
|
|
|
|
|
|
); |
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
|
|
137
|
0
|
0
|
|
0
|
1
|
|
method orgs($user_id) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
138
|
0
|
|
|
|
|
|
return $self->get( "/user/$user_id/orgs?access_token=" . $self->api_key ); |
|
139
|
|
|
|
|
|
|
} |
|
140
|
|
|
|
|
|
|
|
|
141
|
0
|
0
|
|
0
|
1
|
|
method repos($user_id) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
142
|
0
|
|
|
|
|
|
return $self->get( "/user/$user_id/repos?access_token=" . $self->api_key ); |
|
143
|
|
|
|
|
|
|
} |
|
144
|
|
|
|
|
|
|
|
|
145
|
0
|
0
|
|
0
|
1
|
|
method channels($user_id) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
146
|
0
|
|
|
|
|
|
return $self->get( |
|
147
|
|
|
|
|
|
|
"/user/$user_id/channels?access_token=" . $self->api_key ); |
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
1; |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=pod |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=encoding UTF-8 |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head1 NAME |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
WebService::Gitter - An interface to Gitter REST API via Perl 5. |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head1 VERSION |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
version 2.2.0 |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
use strict; |
|
167
|
|
|
|
|
|
|
use warnings; |
|
168
|
|
|
|
|
|
|
use WebService::Gitter; |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
my $git = WebService::Gitter->new(api_key => 'secret'); |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
# Get current authenticated user. |
|
173
|
|
|
|
|
|
|
$git->get_me; |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
# List groups belonging to the authenticated user. |
|
176
|
|
|
|
|
|
|
$git->list_groups; |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
# List all rooms belonging to the group/community. |
|
179
|
|
|
|
|
|
|
$git->rooms_under_group($group_id); |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
# List all rooms belonging to the searched user. |
|
182
|
|
|
|
|
|
|
$git->rooms(q => $query); |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
# List room data via URI. |
|
185
|
|
|
|
|
|
|
$git->room_from_uri(uri => $room_uri); |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
# Join a room. |
|
188
|
|
|
|
|
|
|
$git->join_room($room_id, $user_id); |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
# Leave/remove user from a room. |
|
191
|
|
|
|
|
|
|
$git->remove_user_from_room($room_id, $user_id); |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
# Update room. |
|
194
|
|
|
|
|
|
|
$git->update_room($room_id, topic => $topic, noindex => $noindex, tags => $tags); |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
# Delete room. |
|
197
|
|
|
|
|
|
|
$git->delete_room($room_id); |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
# List all users in a room. |
|
200
|
|
|
|
|
|
|
$git->room_users($room_id, q => $query, skip => $skip_n, limit => $limit_n); |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
# List all messages in a room. |
|
203
|
|
|
|
|
|
|
$git->list_messages($room_id, skip => $skip_n, beforeId => $beforeId, |
|
204
|
|
|
|
|
|
|
afterId => $afterId, aroundId => $aroundId, limit => $limit_n, |
|
205
|
|
|
|
|
|
|
q => $query); |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
# Get single message in a room using its message ID. |
|
208
|
|
|
|
|
|
|
$git->single_message($room_id, $message_id); |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
# Send message/text to a room. |
|
211
|
|
|
|
|
|
|
$git->send_message($room_id, text => $text); |
|
212
|
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
# Update message/text in a room. |
|
214
|
|
|
|
|
|
|
$git->update_message($room_id, $message_id, text => $new_text); |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
# Retrieve unread items and mentions from a room. |
|
217
|
|
|
|
|
|
|
$git->unread_items($user_id, $room_id); |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
# Use to mark chat messages as read. |
|
220
|
|
|
|
|
|
|
$git->mark_unread_items($user_id, $room_id, @chat_ids); |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
# List of the user's GitHub Repositories and their respective Room if available. |
|
223
|
|
|
|
|
|
|
$git->orgs($user_id); |
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
# List of the user's GitHub Repositories and their respective Room if available. |
|
226
|
|
|
|
|
|
|
$git->repos($user_id); |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
# List of Gitter channels nested under the current user. |
|
229
|
|
|
|
|
|
|
$git->channels($user_id); |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=begin html |
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
=end html |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=head1 NOTE |
|
247
|
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
This module does not support Faye endpoint and streaming API..yet. Currently as of writing this, the Gitter's API is |
|
249
|
|
|
|
|
|
|
still in beta and likely to break backward compatibility in the future. |
|
250
|
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=head2 Methods |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
=over 4 |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=item C 'your_api_key')> |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
Description: Set Pixabay API key. |
|
258
|
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=item C |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
Description: Get current authenticated user. |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
Returns: Authenticated user data. |
|
264
|
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=item C |
|
266
|
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
Description: List joined groups by the authenticated user. |
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
Returns: Authenticated user joined groups data. |
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=item C |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
Description: List all rooms belonging to the group/community. |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
Parameter: B C<$group_id> - Group/community ID. |
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
Returns: All rooms data belonging to the particular community. |
|
278
|
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
=item C $query)> |
|
280
|
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
Description: List all rooms belonging to the searched user. |
|
282
|
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
Parameter: B C<$query> - Search/query string. |
|
284
|
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
Returns: All rooms data belonging to the user. |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=item C $room_uri)> |
|
288
|
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
Description: List room data via URI. |
|
290
|
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
Parameter: B C<$room_uri> - Room URI. |
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
Returns: Room from URI response message. |
|
294
|
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
=item C |
|
296
|
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
Description: Join a room. |
|
298
|
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
300
|
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
Parameter: B C<$user_id> - User ID. |
|
302
|
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
Returns: Join room message response. |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
=item C |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
Description: Remove a user from a room. |
|
308
|
|
|
|
|
|
|
This can be self-inflicted to leave the the room and remove room from your left menu. |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
Parameter: B C<$user_id> - User ID. |
|
313
|
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
Returns: Remove user from a room response message. |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
=item C $topic, noindex =E $noindex, tags =E $tags)> |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
Description: Update room. |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
321
|
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
Parameter: B C<$topic> - Room topic. |
|
323
|
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
Parameter: B C<$noindex> - (false, true) Whether the room is indexed by search engines. |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
Parameter: B C<$tags> - 'tag1, tag2, etc' Tags that define the room. |
|
327
|
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
Returns: Update room response message. |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
=item C |
|
331
|
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
Description: Delete room. |
|
333
|
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
Returns: Delete room response message. |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
=item C $query, skip =E $skip_n, limit =E $limit_n)> |
|
339
|
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
Description: List all users in a room. |
|
341
|
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
Note: By default, it will skip 0 and return only 30 users data. |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
345
|
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
Parameter: B C<$query> - User's search/query string. |
|
347
|
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
Parameter: B C<$skip_n> - Skip n users. |
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
Parameter: B C<$limit_n> - Set return limit. |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
Returns: All users data belonging to the room. |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=item C $skip_n, beforeId =E $beforeId, |
|
355
|
|
|
|
|
|
|
afterId =E $afterId, aroundId =E $aroundId, limit =E $limit_n, |
|
356
|
|
|
|
|
|
|
q =E $query)> |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
Description: List all messages in a room. |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
Note: By default, it will skip 0 and return only 30 users data. |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
Parameter: B C<$skip_n> - Skip n messages (constrained to 5000 or less). |
|
365
|
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
Parameter: B C<$beforeId> - Get messages before beforeId. |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
Parameter: B C<$afterId> - Get messages after afterId. |
|
369
|
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
Parameter: B C<$aroundId> - Get messages after aroundId. |
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
Parameter: B C<$limit_n> - Maximum number of messages to return (constrained to 100 or less). |
|
373
|
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
Parameter: B C<$query> - Search query. |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
Returns: List of messages in a room. |
|
377
|
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=item C |
|
379
|
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
Description: Get single message in a room using its message ID. |
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
Parameter: B C<$message_id> - Message ID. |
|
385
|
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
Returns: Retrieve a single message using its ID. |
|
387
|
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
=item C $text)> |
|
389
|
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
Description: Send message/text to a room. |
|
391
|
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
Parameter: B C<$text> - Text to send. |
|
395
|
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
Returns: Retrieve send message response. |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
=item C $new_text)> |
|
399
|
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
Description: Update message/text in a room. |
|
401
|
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
403
|
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
Parameter: B C<$message_id> - Message ID. |
|
405
|
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
Parameter: B C<$new_text> - Text to replace old message. |
|
407
|
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
Returns: Retrieve update message response. |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
=item C |
|
411
|
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
Description: Retrieve unread items and mentions from a room. |
|
413
|
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
Parameter: B C<$user_id> - User ID. |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
417
|
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
Returns: Unread items response. |
|
419
|
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
=item C |
|
421
|
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
Description: Mark chat messages as read. |
|
423
|
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
Parameter: B C<$user_id> - User ID. |
|
425
|
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
Parameter: B C<$room_id> - Room ID. |
|
427
|
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
Parameter: B C<@chat_ids> - List of chat ids to mark as read. |
|
429
|
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
Returns: Marked chat_ids/items response. |
|
431
|
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
=item C |
|
433
|
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
Description: List of the user's GitHub Repositories and their respective Room if available. |
|
435
|
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
B: It'll return private repositories if the current user has granted Gitter privileges to access them. |
|
437
|
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
Parameter: B C<$user_id> - User ID. |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
Returns: User's organizations response. |
|
441
|
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
=item C |
|
443
|
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
Description: List of the user's GitHub Repositories and their respective Room if available. |
|
445
|
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
B: It'll return private repositories if the current user has granted Gitter privileges to access them. |
|
447
|
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
Parameter: B C<$user_id> - User ID. |
|
449
|
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
Returns: User's repositories list data response. |
|
451
|
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
=item C |
|
453
|
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
Description: List of Gitter channels nested under the current user. |
|
455
|
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
Parameter: B C<$user_id> - User ID. |
|
457
|
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
Returns: User's channel list response. |
|
459
|
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
=back |
|
461
|
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
463
|
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
L |
|
465
|
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
L |
|
467
|
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
L |
|
469
|
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
=head1 AUTHOR |
|
471
|
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
faraco |
|
473
|
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
475
|
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
This software is Copyright (c) 2017-2018 by faraco. |
|
477
|
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
This is free software, licensed under: |
|
479
|
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
The MIT (X11) License |
|
481
|
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
=cut |
|
483
|
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
__END__ |