-
Notifications
You must be signed in to change notification settings - Fork 81
/
blobs.py
43 lines (31 loc) · 1.21 KB
/
blobs.py
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
# -*- coding: utf-8 -*-
import struct
from constants import *
from mumble_pb2 import RequestBlob
class Blobs(dict):
"""
Manage the Blob library
"""
def __init__(self, mumble_object):
self.mumble_object = mumble_object
def get_user_comment(self, hash):
"""Request the comment of a user"""
if hash in self:
return
request = RequestBlob()
request.session_comment.extend(struct.unpack("!5I", hash))
self.mumble_object.send_message(PYMUMBLE_MSG_TYPES_REQUESTBLOB, request)
def get_user_texture(self, hash):
"""Request the image of a user"""
if hash in self:
return
request = RequestBlob()
request.session_texture.extend(struct.unpack("!5I", hash))
self.mumble_object.send_message(PYMUMBLE_MSG_TYPES_REQUESTBLOB, request)
def get_channel_description(self, hash):
"""Request the description/comment of a channel"""
if hash in self:
return
request = RequestBlob()
request.channel_description.extend(struct.unpack("!5I", hash))
self.mumble_object.send_message(PYMUMBLE_MSG_TYPES_REQUESTBLOB, request)