public MediaWiki.CurrentUser getCurrentUser() throws IOException, MediaWiki.MediaWikiException {
		final Map<String, String> getParams = paramValuesToMap("action", "query", "format", "xml", "meta", "userinfo", "uiprop", "hasmsg|groups|rights|blockinfo|editcount");
		final String url = createApiGetUrl(getParams);

		networkLock.lock();
		try {
			final InputStream in = get(url);
			final Document xml = parse(in);
			// no checkError: no errors declared for this action

			final NodeList userinfoTags = xml.getElementsByTagName("userinfo");
			if (userinfoTags.getLength() > 0) {
				final Element userinfoTag = (Element) userinfoTags.item(0);

				final boolean isAnonymous = userinfoTag.hasAttribute("anon");
				final String userName = userinfoTag.getAttribute("name");
				final long userID = Long.parseLong(userinfoTag.getAttribute("id"));
				final boolean hasNewMessages = userinfoTag.hasAttribute("messages");
				final String blockedBy = userinfoTag.hasAttribute("blockedby") ? userinfoTag.getAttribute("blockedby") : null;
				final String blockReason = userinfoTag.hasAttribute("blockreason") ? userinfoTag.getAttribute("blockreason") : null;
				final long editCount = Long.parseLong(userinfoTag.getAttribute("editcount"));

				final Collection<String> rights = new TreeSet<String>();
				final Element rightsTag = (Element) userinfoTag.getElementsByTagName("rights").item(0);
				final NodeList rTags = rightsTag.getElementsByTagName("r");
				for (int i = 0; i < rTags.getLength(); i++) {
					rights.add(rTags.item(i).getTextContent());
				}

				final Collection<String> groups = new TreeSet<String>();
				final Element groupsTag = (Element) userinfoTag.getElementsByTagName("groups").item(0);
				final NodeList gTags = groupsTag.getElementsByTagName("g");
				for (int i = 0; i < gTags.getLength(); i++) {
					groups.add(gTags.item(i).getTextContent());
				}

				return new MediaWiki.CurrentUser(isAnonymous, userName, userID, hasNewMessages, groups, rights, editCount, blockedBy, blockReason);
			}
			throw new MediaWiki.ResponseFormatException("expected <userinfo> tag not present");
		} finally {
			networkLock.unlock();
		}
	}