mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-01 04:17:21 +01:00
cleanup
This commit is contained in:
parent
5f5445e757
commit
a2b53d7527
@ -78,14 +78,6 @@ public interface Connection {
|
||||
*/
|
||||
User showUser(long id) throws ConnectionException;
|
||||
|
||||
/**
|
||||
* lookup user and return user information
|
||||
*
|
||||
* @param name screen name of the user
|
||||
* @return user information
|
||||
*/
|
||||
User showUser(String name) throws ConnectionException;
|
||||
|
||||
/**
|
||||
* search for users matching a search string
|
||||
*
|
||||
|
@ -267,18 +267,6 @@ public class Mastodon implements Connection {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public User showUser(String name) throws MastodonException {
|
||||
List<String> params = new ArrayList<>();
|
||||
params.add("acct=" + StringUtils.encode(name));
|
||||
try {
|
||||
return createUser(get(ENDPOINT_LOOKUP_USER, params));
|
||||
} catch (IOException e) {
|
||||
throw new MastodonException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Users searchUsers(String search, long page) throws MastodonException {
|
||||
List<String> params = new ArrayList<>();
|
||||
@ -1446,6 +1434,22 @@ public class Mastodon implements Connection {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get user by screen name
|
||||
*
|
||||
* @param name screen name (@username)
|
||||
* @return user instance
|
||||
*/
|
||||
private User showUser(String name) throws MastodonException {
|
||||
List<String> params = new ArrayList<>();
|
||||
params.add("acct=" + StringUtils.encode(name));
|
||||
try {
|
||||
return createUser(get(ENDPOINT_LOOKUP_USER, params));
|
||||
} catch (IOException e) {
|
||||
throw new MastodonException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get information about the current user
|
||||
*
|
||||
@ -1802,7 +1806,7 @@ public class Mastodon implements Connection {
|
||||
}
|
||||
|
||||
/**
|
||||
* create get response with user bearer token
|
||||
* create get response with current bearer token
|
||||
*
|
||||
* @param endpoint endpoint to use
|
||||
* @param params additional parameters
|
||||
@ -1830,7 +1834,7 @@ public class Mastodon implements Connection {
|
||||
}
|
||||
|
||||
/**
|
||||
* create post response with user bearer token
|
||||
* create post response with current bearer token
|
||||
*
|
||||
* @param endpoint endpoint to use
|
||||
* @param params additional parameters
|
||||
|
@ -24,6 +24,7 @@ public class PushNotificationReceiver extends MessagingReceiver implements Async
|
||||
@Override
|
||||
public void onMessage(@NonNull Context context, @NonNull byte[] message, @NonNull String instance) {
|
||||
GlobalSettings settings = GlobalSettings.get(context);
|
||||
// check if received push notification is intended for the current login
|
||||
if (settings.isLoggedIn() && settings.pushEnabled() && settings.getLogin().getConfiguration().isWebpushSupported() && settings.getPushInstance().equals(instance)) {
|
||||
NotificationLoader loader = new NotificationLoader(context);
|
||||
NotificationLoader.Param param = new NotificationLoader.Param(NotificationLoader.Param.LOAD_UNREAD, 0, 0L, 0L);
|
||||
|
Loading…
Reference in New Issue
Block a user