2017-03-02 14:37:32 +00:00
|
|
|
namespace Xmpp {
|
|
|
|
string? get_bare_jid(string jid) {
|
|
|
|
return jid.split("/")[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
bool is_bare_jid(string jid) {
|
|
|
|
return !jid.contains("/");
|
|
|
|
}
|
|
|
|
|
|
|
|
string? get_resource_part(string jid) {
|
|
|
|
return jid.split("/")[1];
|
|
|
|
}
|
2017-03-10 15:02:32 +00:00
|
|
|
|
|
|
|
public string random_uuid() {
|
|
|
|
uint8[] rand = new uint8[16];
|
|
|
|
char[] str = new char[37];
|
|
|
|
UUID.generate_random(rand);
|
|
|
|
UUID.unparse_upper(rand, str);
|
|
|
|
return (string) str;
|
|
|
|
}
|
2017-03-02 14:37:32 +00:00
|
|
|
}
|